Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > error console says document.forms[0].submit not a function

Reply
Thread Tools

error console says document.forms[0].submit not a function

 
 
pantagruel
Guest
Posts: n/a
 
      05-21-2007
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.

 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      05-21-2007
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.


--

 
Reply With Quote
 
 
 
 
pantagruel
Guest
Posts: n/a
 
      05-22-2007
On May 21, 5:01 pm, Lee <(E-Mail Removed)> 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.




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Preventing the console window from closing when writing a console program in C++ Miktor C++ 7 08-09-2005 09:22 PM
Dell says no & Acronis says maybe sysprep utility ( Re: Anyone use Acronis Drive Image 7.0? Bobby Fischler Computer Support 0 07-24-2004 12:12 AM
Re: console mp3->wav decoder for $indows or GUI one which supports console Serge Terekhoff Python 0 06-30-2003 12:36 PM
Re: console mp3->wav decoder for $indows or GUI one which supports console Egor Bolonev Python 0 06-30-2003 10:43 AM
Re: console mp3->wav decoder for $indows or GUI one which supports console Ben Finney Python 2 06-30-2003 05:43 AM



Advertisments