I encountered a very strange problem, that is, when using JavaScript to control form submission, the browser prompts document.genForm.submit is not a function. Genform is the name of the form <form>, and another form using the same function is performing normally, looking for a long time also did not find two different, and then searched the Internet for some, the result found the reason.
When the form <form>...</form> contains name= "Submit", there is a conflict when submitting, this error is common on the button, such as:
When the JavaScript does submit (), there will be conflicts, then will name= "submit" to other things such as login and so on, anyway submit in this case is a reserved keyword.
Instance
<form name= "Detailform" action= "adminsearchperformance.do" method= "POST" > <input type= "hidden" value= "${" Userperformance.userid} "name=" UserId "/> <input type=" hidden "value=" ${userperformance.username} "Name=" TeacherName "/> <input type=" hidden "value=" "1" name= "admin"/>
</form> <a href= "Javascript:document.detailForm.submit ();" class= "A-comm" > View details </a></td>
Solutions
<a href= "javascript:document.getall[" Detailform "].submit ();" class= "A-comm" > View details </a></td>
Sometimes it is necessary to submit the form in JavaScript, it is likely that everyone will use Javascript:myForm.submit (), but in doing so how to submit unsuccessful, in the FF view JavaScript errors JavaScript error: The submit is not a function. The reason may be that when the form is submitted with Myform.submit (), the form contains elements of the name= "submit", which, when submitted, will be confused with the Submit () method, causing the error!