且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

验证中的PHP问题

更新时间:2023-02-26 18:34:49

使用javascript提交表单。验证后使用javascript代码在函数MM_validateForm()的末尾提交表单。在每次验证中添加return false部分。

Hi,

I have a form like below, in onsubmit I have added a validation and also, I have added action.

My problem is onsubmit and action are running at same time. First I want to validate the form, if there validation error occurred, no need to run the php or action. If there is no error then php or action should be run. Please help me.

<form onsubmit="MM_validateForm()" action="code_exec.php" method="post" name="reg">

submit the form using the javascript.After the validation use the javascript code for submitting the form at the end of the function MM_validateForm().Add return false in each validation section.