Submit form with submit button validation failed to submit forms by still

Source: Internet
Author: User

<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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.