关于按下回车键自动提交表单问题解决

当直接按下回车键时,会默认提交表单,会发现表单提交报错,这时候需要,否则会报does not contain handler parameter named 'method'. This may be caused by whitespace in the label text

<html:form styleClass="pure-form pure-form-aligned" 
        action="/paymentScheme.do?action=initPaymentSchemeExamine" method="post">

但是又会发现表单自动提交调用initPaymentSchemeExamine方法,只要  在 html:form标签中添加  onsubmit='return false'   即可,最终如下

<html:form styleClass="pure-form pure-form-aligned" onsubmit='return false'
        action="/paymentScheme.do" method="post">

 

posted @ 2020-06-02 20:21  愚蠢的程序员  阅读(459)  评论(0编辑  收藏  举报