|
|
 |
 |
 |
 |
Javascript / Client Side Development
|
 |
 |
 |
 |
 |
 |
 |
 |
error console says document.forms[0].submit not a function
As per the subject line, Firefox's error console says document.forms[0].submit is not a function. the javascript is function makequery(param){ document.forms[0].qu.value=param; document.forms[0].submit(); }
called by clicking on a link with a javascript url. the value of qu gets changed correctly. this same thing happens if I use the name of the form, which is main. document.main.submit() is not a function.
pantagruel said: >As per the subject line, >Firefox's error console says document.forms[0].submit is not a >function. >the javascript is >function makequery(param){ >document.forms[0].qu.value=param; >document.forms[0].submit(); >}
The error is in your HTML. You've named something "submit", haven't you? If you name a control "submit", then document.forms[0].submit refers to that control, not the function. Change the name. --
On May 21, 5:01 pm, Lee <REM0VElbspamt@cox.net> wrote:
> pantagruel said: > >As per the subject line, > >Firefox's error console says document.forms[0].submit is not a > >function. > >the javascript is > >function makequery(param){ > >document.forms[0].qu.value=param; > >document.forms[0].submit(); > >} > The error is in your HTML. > You've named something "submit", haven't you? > If you name a control "submit", then document.forms[0].submit > refers to that control, not the function. > Change the name. > --
hmm thanks, I think that's right. The page I'm working on is generated from somewhere else and I'm adding to it via a proxy but I think the button doing the submitting is named submit.
|
 |
 |
 |
 |
|