Home > php教程 > php手册 > submit与onsubmit(转),submitonsubmit

submit与onsubmit(转),submitonsubmit

WBOY
Release: 2016-06-13 08:54:40
Original
1298 people have browsed it

submit与onsubmit(转),submitonsubmit

发生顺序:onsubmit -> submit

1.阻止表单提单:

<script><br />function submitFun(){<br /> //逻辑判断<br /> return true; //允许表单提交<br /> //逻辑判断<br /> return false;//不允许表单提交<br />}<br /></script>

 //注意此处不能写成 onsubmit="submitFun();"否则将表单总是提交

2.onsubmit()与submit() :

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


   


    


Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template