Usually like to write this verification
<form method="Post"data-ajax="false"action="/shppping/placeorder"Id="OrderForm"> <aclass="Btnpay"href="javascript:void (0)"onclick="return Checksubmit ();"Id="Btnpay"> Payments </a> <aclass="Btncancel"Id="Btncancel"href="javascript:void (0)"> Cancel </a></form>
Then there's the Checksubmit method.
function Checksubmit () {varErrorMsg =""; varSJ = $ ("#ordertime"); varSFZ = $ ("#orderncerti"); varDyz = $ ("#ordernguideCard"); varLxs = $ ("#orderntravelAgency"); varSMR = $ ("#ordername"); varSJH = $ ("#orderphone"); if(Sj.length >0&& sj.val () = ="") {errormsg="Please select a travel date"; } Else if(Sjh.length >0&& sjh.val () = ="") {errormsg="phone number is not correct"; } Else if(Smr.length >0&& smr.val () = ="") {errormsg="please fill in your name"; } Else if(Sfz.length >0&& sfz.val () = ="") {errormsg="please fill in the ID number"; } Else if(Dyz.length >0&& dyz.val () = ="") {errormsg="please fill in the Guide card number"; } Else if(Lxs.length >0&& lxs.val () = ="") {errormsg="please fill in the name of travel agency"; } Else if($(". Ochooseno1.active"). Length = =0|| $(". Ochooseno2.active"). Length = =0) {errormsg="Please select a payment method"; } if(ErrorMsg! ="") {alert (errormsg); return false; } //$ ("#orderForm"). Submit ();Alert"Submit Success"); return false; //return true;}
Then there is the use of validate.js
Validation of Validator