//Custom Validation input priceJQuery.validator.addMethod ("Pricecheck",function(value, Element) {varBreaknumber=0; $(". Producprice"). each (function(k, v) {if($.trim ($ ( This). val ()) = = "") { $( This). focus (); Breaknumber++; return false; } }); if(breaknumber>0){ return false; }Else{ return true; }}, "Please enter the price");
<Tablecellspacing= "0"Border= "0"style= "Border-collapse:collapse;">
<tbody>
<TR>
<TDstyle= "text-align:right;">445</TD>
<TDstyle= "Text-align:left;"><inputtype= "text"class= "Form-control producprice"placeholder= "Price"ID= "Txtprice"name= "Txtprice"PID= "1"></TD>
</TR>
<TR>
<TDstyle= "text-align:right;">Test</TD>
<TDstyle= "Text-align:left;"><inputtype= "text"class= "Form-control producprice"placeholder= "Price"ID= "Txtprice"name= "Txtprice"PID= "3"></TD>
</TR>
</tbody>
</Table>
I have generated several input boxes with class-style producprice.
Verify:
$ ("#form1"). Validate ({ rules: { txtloginname: { required:true //remote:remotehasausernamefun () } txtprice:{ pricecheck:true } }, messages: { txtloginname: { required: "Please enter account" } }, Errorlabelcontainer: $ (". Bg-info") });
jquery Validate Custom validation method (not fixed validation)