Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Dear All,
I would like to get data from a popup window. I had design the following code. When I run test.asp and click the button, the popup window will show and the user can input data in the input box. After that, the user click the button in popup window. The test.asp will show the data.
The problem is I cannot show the data without the input box in test.asp. Can save the data to Session("aaa") in popup window? Then, I can use Response.write Session("aaa") to show the data without the input box.
test.asp
<SCRIPT LANGUAGE="JavaScript">
function ShowPopup(oDoc)
{
window.open("test2.asp?backf="+oDoc,"window", "height=210, width=300, resizeable=no,","");
}
</script>
Please click the button to add the text:</p>
<form method="POST" name="HICSF">
<input id="VonDatum" type="text" name="txtDate" size="20" >
<input type="button" value="Click me to add" onClick="javascript:ShowPopup('HICSF.VonDatum')"></form>
test2.asp
<%
RecObj = Request.QueryString("backf")
Response.Write "<Script language='javascript'> "
Response.Write "var l_SelDate; "
Response.Write "function PutDate() "
Response.Write "{ "
Response.Write "window.opener." & RecObj & ".value = document.test2.T1.value; "
Response.Write "window.close(); "
Response.Write "} "Response.Write "</Script> "
%>
<Script language="javascript">window.moveTo((window.screen.width - 300),(window.screen.height - 125)/2);
</Script>
<form method="POST" action="" name="test2"><input type="text" name="T1" size="20"></p>
<input type="submit" value="Submit" name="B2" onClick="javascript:PutDate();"></p>
</form>
Thank you very much!
Charles

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |