F
Fred
Please consider the following two if() structures. The first one fails, yet
the second works. Why? FWIW, I got the syntax of the first out of a working
page. I figured moving it to another page would be harmless. What's going on
here? The only major difference between the two pages that I can see so far
is that in the new page (where the first if() structure fails), the control
imgname is in a <form runat="server" method="post"> whereas in the page it
came from, there is no <Form> at all on the page. Could that have some
relevance?
// This one fails
if(v_incoming != "")
{
imgname.value = v_incoming; // this errors out with message: 'imgname' is
undefined.
}
// This one works
if(v_incoming != "")
{
var obj_imgname = document.all("imgname");
obj_imgname.value = v_incoming; //no problems
}
here is the definition of imgname:
<input type="text" id="imgname" size="40" value="http://" NAME="imgname">
Thanks!
the second works. Why? FWIW, I got the syntax of the first out of a working
page. I figured moving it to another page would be harmless. What's going on
here? The only major difference between the two pages that I can see so far
is that in the new page (where the first if() structure fails), the control
imgname is in a <form runat="server" method="post"> whereas in the page it
came from, there is no <Form> at all on the page. Could that have some
relevance?
// This one fails
if(v_incoming != "")
{
imgname.value = v_incoming; // this errors out with message: 'imgname' is
undefined.
}
// This one works
if(v_incoming != "")
{
var obj_imgname = document.all("imgname");
obj_imgname.value = v_incoming; //no problems
}
here is the definition of imgname:
<input type="text" id="imgname" size="40" value="http://" NAME="imgname">
Thanks!