首页 > Web开发 > 详细

js阻止表单重复提交

时间:2016-02-18 21:36:09      阅读:250      评论:0      收藏:0      [点我收藏+]
//校验表单的数据
function newFatherModuleVerify()
{
    var moduelName = $(‘#fatherModule_moduelName‘).val();
    alert(moduelName);
    return false;
}
        <form:form commandName="fatherModule" action="saveFatherModule" onsubmit="return newFatherModuleVerify();" method="post">
            <table class="au">
                <tr>
                    <td>版块名称</td>
                    <td><form:input id=‘fatherModule_moduelName‘ path="moduelName"/></td>
                    <td>支持HTML代码</td>
                </tr>
                <tr>
                    <td>排序</td>
                    <td><form:input id=‘fatherModule_sort‘ path="sort"/></td>
                    <td>支持HTML代码</td>
                </tr>
            </table>
            <input class="btn" style="cursor: pointer; margin-top: 10px"
                type="submit" name="submit" value="添加">
        </form:form>

关键在于要加上return

onsubmit="return newFatherModuleVerify();"

 

js阻止表单重复提交

原文:http://www.cnblogs.com/rocky-AGE-24/p/5199284.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!