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
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top