Home  >  Article  >  Backend Development  >  submit and onsubmit (transfer), submitonsubmit_PHP tutorial

submit and onsubmit (transfer), submitonsubmit_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 16:53:581524browse

submit and onsubmit (transfer), submitonsubmit

order of occurrence: onsubmit -> submit

1. Block form bill of lading:

<script><br>function submitFun(){<br> //Logical judgment<br> return true; //Allow form submission<br> //Logical judgment<br> return false;//Not allowed Form submission<br>}<br></script>

//Note that onsubmit=" cannot be written here submitFun();"Otherwise the form will always be submitted

2.onsubmit() and submit():

<script><br>function fun()<br>{<br> alert("form_submit");<br>}<br></script>








www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1053800.htmlTechArticlesubmit and onsubmit (transfer), submitonsubmit occurs in sequence: onsubmit - submit 1. Prevent form bill of lading: script function submitFun( ){ //Logical judgment return true; //Allow form submission //Logic...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn