Can I change the min, max of a number’s validation at runtime ?
I use jQuery validation plugin.
My simplified layout and structure to demonstrate how it should work. when I change the value of max range the max range’s validation of the field number has to be changed too.
jsFiddle:
http://jsfiddle.net/nXqd/qC2Ya/3/
Thanks
Updated demo: http://jsfiddle.net/techfoobar/qC2Ya/5/
You can do this by specifying
minandmaxoptions in your validation rules:For ex:
API Docs:
http://docs.jquery.com/Plugins/Validation/Methods/min#value
http://docs.jquery.com/Plugins/Validation/Methods/max#value