How To Validate Integer Value In Jquery August 10, 2023 Post a Comment I need to validate input field, it should be integer(0-100), if max_seat = 5 then min_seat should be less than or equal to max_seats. CopyYou must declare each rule separately. And for an integer, you can use the digits method.Your HTML is also not valid for this plugin...<inputclass="span6 "id="max_seat" name="default_seats"type="text" /> <inputclass="span6 "id="min_seats" name="default_seats"type="text" /> CopyEach field must contain a uniquename attribute and you would declare your rules based on that name. (Declare the messages option similarly)rules: { min_seats: { //<-thisistheNAMEattributeofthefield, notIDrequired:true, digit:true }, max_seats: { //<-thisistheNAMEattributeofthefield, notIDrequired:true, digit:true } } CopyTo compare the two fields, you must use the .addMethod() method and declare your new custom rule the same as above. Share You may like these postsHow To Put Red Border In The Radio Button If Jquery Validation ActivatesRegex In Jquery Validation - Single Quote Issue In JqueryHow To Create A Universal Jquery Validate And Reset Function CallJquery Validation Not Getting Options Post a Comment for "How To Validate Integer Value In Jquery"
Post a Comment for "How To Validate Integer Value In Jquery"