<form id="SB"action="${pagecontext.request.contextpath}/admin/loancontract/addorupdate.do"Method="Post"onsubmit="submittest ();"><divclass="J_dd"> <divclass="Clearfix"> <spanclass="Ftit Left"> Trade Order Number: </span><input type="text" class="txt left ui-autocomplete-input"Id="Tradecode"Name="Tradecode"onkeyup="Value=value.replace (/[\w]/g, ")"Onbeforepaste="clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\d]/g, ")"style="width:300px;"/>*<span style="color:red; display:block; padding-left:85px; clear:both; padding-top:5px ;"Id="SP"Name="SP"></span> </div> <divclass="Clearfix"style="margin-top:10px"> <spanclass="Ftit Left"> Remarks:</span> <textarea id="Tradeintro"Name="Tradeintro"style="width:305px;"></textarea> </div> <divclass="BigBox Clearfix"> <buttonclass="tjbtn"Type="Submit"Id="SBM"> Submit </button> <a href="${pagecontext.request.contextpath}/admin/loancontract/loanitem.do?contents=platform"title="" class="tjbtn"> Cancel </a> </div></form><script type="Text/javascript">//Ajax Validation Database whether the trade order already exists varOrderinfoconfirm ={modifyorderinfo:function () {$ ("#tradeCode"). blur (function () {varTradecode = $ ("#tradeCode"). Val (); if(Tradecode = =""){ $("#sp"). HTML ("Please enter a trade order number!"); return; } $.ajax ({URL:"checktradecode.do", Data:{tradecode:tradecode}, DataType:"JSON", Success:function (data) {vararr =eval (data); $("#sp"). HTML (Arr.code); } }); }); }, Submittest:function () {$ ("#sbm"). Click (function () {if(Tradecode = =""){ $("#sp"). HTML ("Please enter a trade order number!"); return false; } varSP = $ ("#sp"). html (); if(sp = ="The trading order already exists! "|| SP = ="Please enter a trade order number!"){ return false; } Else return true; }); } }; $ (document). Ready (function () {orderinfoconfirm.modifyorderinfo (); Orderinfoconfirm.submittest (); }); </script>
Submit form with submit button validation failed to submit forms by still