G
Guest
I have a web form “Form1†with a panel. Inside the panel is a datalist. One
of the items displays the field value “xyz†from the dataset. If the field
is null the user clicks on a javascript to let him pick a value for the field
from a popup modal window.
<td><a href="javascript:GetNet()"> <img src="â€> </a>VPN Network:</td>
<% if (XYZ !=""){%>
<td><asp:TextBox id="txtXYZ" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "XYZ") %>'></asp:TextBox>
<%}else{%>
<input type="text" runat=server id="XYZ">
<%}%></td>
The javascript on modal form tries to put a value selected back into
form1.XYZ with
function pasteNet(lstr)
{
window.opener.document.forms["Form1"].elements["XYZ"].value = lstr;
window.close();
}
I get the error
Microsoft JScript runtime error:
'window.opener.document.forms.Form1.elements.vpnnet' is null or not an object
Is the syntax for identifying the server control input box incorrect? Does
it have to do with the input box being nested in the “if statementâ€. If I
use an html input box it works fine, the problem I need to attach code to the
input box so server control.
Please help
cindy
of the items displays the field value “xyz†from the dataset. If the field
is null the user clicks on a javascript to let him pick a value for the field
from a popup modal window.
<td><a href="javascript:GetNet()"> <img src="â€> </a>VPN Network:</td>
<% if (XYZ !=""){%>
<td><asp:TextBox id="txtXYZ" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "XYZ") %>'></asp:TextBox>
<%}else{%>
<input type="text" runat=server id="XYZ">
<%}%></td>
The javascript on modal form tries to put a value selected back into
form1.XYZ with
function pasteNet(lstr)
{
window.opener.document.forms["Form1"].elements["XYZ"].value = lstr;
window.close();
}
I get the error
Microsoft JScript runtime error:
'window.opener.document.forms.Form1.elements.vpnnet' is null or not an object
Is the syntax for identifying the server control input box incorrect? Does
it have to do with the input box being nested in the “if statementâ€. If I
use an html input box it works fine, the problem I need to attach code to the
input box so server control.
Please help
cindy