Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit function does ot submit

Status
Not open for further replies.

RPrinceton

Programmer
Jan 8, 2003
86
US
Hi All,
I am trying to use Javascript to submit a form as opposed to the button doing the submit.
Below is the code used to do this. I have included notes
as to what happens when the button is clicked. I hope it is clear. I am testing in both Internet Explorer and Firefox.
I am not sure if its a version thing. Any help will be greatly appriciated.
Thx in advance.
Regards.
RPrinceton

HTML:
<td width=100% align=center colspan=4><input type="button" value="Validate" onclick="formSubmit()" name="submit"></td>

Javascript:
function formSubmit()
{
document.getElementById("ThisForm").submit(); <- in IE says error on page, in FF no error but submit does not take place
}

function formSubmit()
{
document.getElementById("ThisForm").submit; <- in IE says error on the page, in FF no error but submit does not take place says
}



 
Hi Everyone,
I "Googled" the error message "submit is not a function" and apparently someone else was having the same issue. I have pasted the link to this issue.
Seems the "name" attribute is the culprit. I removed the name attribute and the form submits.
Please consider this issue closed.
Regards,
RPrinceton
 
name is a required attribute of a form tag. you should provide a name other than "submit" and should always strive to use words that are not reserved javascript keywords.



*cLFlaVA
----------------------------
[tt]mr. pibb + red vines = crazy delicious![/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top