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

P

pantagruel

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.
 
L

Lee

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.


--
 
P

pantagruel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top