I have a single form in my web page. The Form is defined as
<FORM action="somepage.asp" method="post" id="Form1" >
<INPUT TYPE="Text" Name="txt1" id="txt1" size=5 >
</FORM>
In a javascript function, when I am writing
document.Form1.txt1.value = 5 ;
I am getting an error "document.Form1.txt1 is invalid or null".
Instead if I write
document.forms[0].txt1.value = 5 ;
it is working fine. What is wrong with the first statement ? I am using Visual Interdev 6, in which the dropdown list that appears for a object method/properties, is showing Form1 as a property of document and txt1 as a property of Form1 when I press dot(.) after the object name.