By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,504 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,504 IT Pros & Developers. It's quick & easy.

javascript error: document.forms[0].elements is null or not an object

P: 7
this js function is giving javascript error: document.forms[0].elements is null or not an object

Expand|Select|Wrap|Line Numbers
  1. function DisableText()
  2. {
  3. var count = document.forms[0].elements.length;
  4. for (i=0; i<count; i++) 
  5.   {
  6. document.forms[0].elements[i].disabled=false; 
  7.  
  8. }
please help to find out what's the problem?
Oct 22 '07 #1
Share this Question
Share on Google+
3 Replies


gits
Expert Mod 5K+
P: 5,390
hi ...

when do you call the DisableText()-method? is the dom ready at this moment ... that means is the entire page loaded already?

kind regards
Oct 22 '07 #2

P: 7
ok, now its becoming editable but the problem is even though elements now became editable, they are still gray in color e.g.- label of radio buttons, text of text area etc.

this js function is giving javascript error: document.forms[0].elements is null or not an object

Expand|Select|Wrap|Line Numbers
  1. function DisableText()
  2. {
  3. var count = document.forms[0].elements.length;
  4. for (i=0; i<count; i++) 
  5.   {
  6. document.forms[0].elements[i].disabled=false; 
  7.  
  8. }
please help to find out what's the problem?
Oct 22 '07 #3

gits
Expert Mod 5K+
P: 5,390
hi ...

please post an example of your code (even the html) that relates to this problem ... so that we may have a closer look at it ...
Oct 22 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.