Title: validatebox, adding a new rule Post by: chrwei on August 22, 2013, 02:09:36 PM I'm looking for a cleaner way to do this:
Code: <script> goal is to require one or more of the 3 values to be entered. I'm using enableValidation/disableValidation calls because my new validator does not seemed to be called when a box is blank. is there a better way? Title: Re: validatebox, adding a new rule Post by: stworthy on August 22, 2013, 07:06:54 PM After calling 'disableValidation' method, you need to call 'enableValidation' method again in some conditions. The simplest way to enable validation again is to recall 'enableValidation' method when value changed.
Code: $('#box1,#box2,#box3').bind('keyup',function(){ Title: Re: validatebox, adding a new rule Post by: chrwei on August 23, 2013, 06:27:11 AM this is because if the value is selected and deleted, the validation won't fire since it doesn't run when the value is blank? would it be a bad thing to run validation functions on blank values anyway?
|