jQuery Validate and disabled input field
There is no direct solution... if the field is "disabled" via the disabled
attribute, the jQuery Validate plugin will always ignore it. (Logically, there is no point in validating something the user cannot edit.)
However there is a workaround. If you use the readonly
attribute instead of disabled
, it can be validated.
<input type="text" name="abc" readonly="readonly" />
DEMO: http://jsfiddle.net/85pu1oe5/
Seems like you need to use the readonly="readonly"
attribute http://www.w3schools.com/tags/att_input_readonly.asp