J
Jason Wilson
I am trying to create a popup window that will give a user the option
to lookup a value and return it to a textbox on the parent page.
Here is my relevant code:
Code on Parent
<form id="frmCoding" action="CodeView.aspx" method="post"
runat="server">
...
CPT1<asp:Textbox ID="txtCPT1" runat="server" Width="240px" />
<input ID="butLookupCPT1" type="button"
style="color:#003399;font-family:Arial;font-weight:bold;"
onclick="javascript:LaunchCPTLookup();" value="?" />
...
<script type="text/javascript">
function LaunchCPTLookup(){
window.open("CPTLookup.aspx", "CPTLookup");
}
</script>
Code on Child
<form id="frmTest" name="frmTest">
<input type="text" name="txtTest" />
<input type="button" onclick="Test();" value="Test" />
</form>
<script type="text/javascript">
function Test(){
if (window.opener && !window.opener.closed)
window.opener.document.frmCoding.txtCPT1.Value =
document.frmTest.txtTest.Value;
window.close();
}
</script>
I don't get any errors on the child, but when I enter a value and click
the button the window closes but nothing changes on the parent.
Help?
to lookup a value and return it to a textbox on the parent page.
Here is my relevant code:
Code on Parent
<form id="frmCoding" action="CodeView.aspx" method="post"
runat="server">
...
CPT1<asp:Textbox ID="txtCPT1" runat="server" Width="240px" />
<input ID="butLookupCPT1" type="button"
style="color:#003399;font-family:Arial;font-weight:bold;"
onclick="javascript:LaunchCPTLookup();" value="?" />
...
<script type="text/javascript">
function LaunchCPTLookup(){
window.open("CPTLookup.aspx", "CPTLookup");
}
</script>
Code on Child
<form id="frmTest" name="frmTest">
<input type="text" name="txtTest" />
<input type="button" onclick="Test();" value="Test" />
</form>
<script type="text/javascript">
function Test(){
if (window.opener && !window.opener.closed)
window.opener.document.frmCoding.txtCPT1.Value =
document.frmTest.txtTest.Value;
window.close();
}
</script>
I don't get any errors on the child, but when I enter a value and click
the button the window closes but nothing changes on the parent.
Help?