How can I validate field by range?
I use additional-methods, but i don't know how providing parametr with range to my validation method via HTML.
Something of a<input type="text" class="rangeField" rel="[10, 20]" />
It's nice, if i can make a difference between integer and decimal in validation.
Are you using the Validation plugin? This plugin makes it trivial to validate against a range.
$("#myform").validate({
rules: {
field: {
required: true,
range: [13, 23]
}
}
});
<input type="text" id="myrange" name="myrange" class="field" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With