Wednesday, May 15, 2024
 Popular · Latest · Hot · Upcoming
146
rated 0 times [  152] [ 6]  / answers: 1 / hits: 30160  / 12 Years ago, sat, september 22, 2012, 12:00:00

Can anyone explain to me what this error means? I would appreciate it a lot for any kindof help with this.



<form class=form id=form action=/mailer.php method=post>


The Jquery code I'm using for it is this.



$('#form').submit();  

More From » jquery

 Answers
53

Check the form to see whether there is a HTMLInputElement with id or name is submit.



This will set a property submit to the HTMLFormElement, so the submit function which is in the prototype of the form element can't be executed.



Example:



<form class=form id=form action=/mailer.php method=post>
​<input type=button name=submit value=go/>
</form>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​


js:



​console.log($(#form)[0].submit)​;​  // will be the button element, not the submit function.


jQuery's .submit() method will call the .submit() on the original dom element, so the error will happen.


[#82959] Thursday, September 20, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
joanneamiyaa

Total Points: 532
Total Questions: 127
Total Answers: 98

Location: Guam
Member since Tue, Nov 3, 2020
4 Years ago
;