document.form[0] is Null or Not an Object error when hiding a text field in ASP.Net
I am hiding a TextBoxin my aspx page like this:
myField.visible=false;
Now I have a DropDown as well which tries to access the TextBox开发者_如何学编程 on IndexChange. The problem is, it cant access the hiffen TextBox and I am getting document.form[0] is Null or Not an Object. How can I solve that? Is the some check for that in JavaScript?
Thanks :-)
If you are trying to access the first form in the document via its numerical index (hint: You shouldn't be, the id attribute is very handy, then you are looking for the first in a group of forms, not the first in a group of form.
document.forms[0] // It is plural
精彩评论