A form element if set to disabled, then the element value will not posted. This is a standard behaviour, Apart from form submission, disabled elements have following effects:
 
  • Disabled elements will not receive focus
  • Disabled elements are skipped in tab navigation
  • Disabled elements will not be posted
Following elements supports disabled attribute: BUTTON, INPUT, OPTGROUP, OPTION, SELECT, TEXTAREA

This example shows you how to set disabled property for INPUT
<input name='sample' value='test' disabled>

To overcome this problem either we can set a hidden input with same name and value or we can make this element as read-only like this one:
<input name='sample' value='test' readonly>
That's it. If you interested, just checkout disabled vs read only differences

 


Comments (0)
Leave a Comment

loader Posting your comment...