First type: Native mode
Note: The button tag has a style of submit
<form action="/trans/doTrans.do" method="post"> 转出卡号:${cardNo} <br> 转出卡号余额:${balance}元 <br> <br> 转入卡号:<input name="checkInCardNo" type="text"> <br> 转入卡号姓名:<input name="realName" type="text"> <br> 转出金额:<input name="money" type="text"> <br> <button type="submit">确定转出</button></form>
The second type: jquery check mode
Note: The button label has a style of button
Process: Click Submit, First trigger the SubmitForm () method, execute the checksum ID selector, and finally submit form form.
<script type= "Text/javascript" > Function SubmitForm () {if ($ ("#t_in_cardNo"). Val (). length!=8) { Alert ("You have entered the wrong number of cards!") ") return; } $ ("#transForm"). Submit ();<!--Here is the Submit method--} </script>
<form id= "TransForm" class= "Am-form am-form-horizontal" action= "/trans/dotrans.do" method= "POST" > <div class = "Am-form-group" > <label class= "am-u-sm-3 Am-form-label" > Ext card number </label> <div class= "am-u-sm- 9 "> <input type=" text "id=" T_cardno "readonly placeholder=${cardno}> </div> </DIV&G T <div class= "Am-form-group" > <label class= "am-u-sm-3 Am-form-label" > Transfer card number </label> <DIV cl ass= "am-u-sm-9" > <input type= "text" id= "T_in_cardno" pattern= "[0-9]*" placeholder= "Please enter 8-digit offset card number" Name= "Checkincardno" > </div> </div> <div class= "Am-form-group" > <label class= "am-u-sm-3 Am-form-label" > Transfer amount </label> <div class= "am-u-sm-9" > <input type= "text "Id=" T_money "placeholder=" Enter the transfer amount "name=" Money "> </div> </div> <div class=" Am-form-group "& Gt <div Class= "Am-u-sm-9 am-u-sm-push-3" > <button type= "button" onclick= "SubmitForm ()" class= "Am-btn Am-btn-primar Y "> Submit </button><!--Here for the submission type button--> </div> </div></form>
Learn how to submit two forms of form form in Java front end