Using a variable in jQuery validation -
i validate field max number , works great:
jquery.validator.setdefaults({ debug: true, success: "valid" }); $( "#registration" ).validate({ rules: { max_number: { required: true, max: 3 } } }); what replace max: 3 variable have been using (available_seats). works fine number there, when use variable (value of 10) doesn't work @ all. suggestions?
jquery.validator.setdefaults({ debug: true, success: "valid" }); $( "#registration" ).validate({ rules: { max_number: { required: true, max:available_seats } } });
converting variable int with:
parseint(available_seats)
Comments
Post a Comment