• Holiday Schedule

    Your code gophers will be away for the next couple of weeks so support will be sporadic. We should be fully back online by the end of September.

  • A new version of Full Calendar is now available.

    See the details here

disable field password

mvilela

Member
I want to disable password field through javascript when field 1 = yes. JavaScript disable the password box but not the confirm password box. How to overcome this
 
When we enable JavaScript to disable the field, it happens that when the field is subject to mandatory validation, it reports error. This situation is transversal to all types of fields
Mvilela
 
Yes. You''ll have to put a Condition on that validation, which checks whatever conditions you used to hide the field.

So for example, if you have a radio button with values 0 and 1, and you hide the password field if that element is 1, then in your validation condition on the password:

return $formModel->formData['yourtable___yourradio'] != '1';

... which should prevent the validation from running.

-- hugh
 
Back
Top