I want to programmatically allow or hide a form field from being submitted in an HTML5 form. I thought I could just set its CSS display attribute to none. However, it still gets submitted (just can't be seen). Is there another property I can set rather than removing the element completely from the HTML5 document?
Simply set disabled attribute for the form field, e.g.
<input name="test" value="test" disabled="disabled">
REF: http://www.w3.org/TR/html401/interact/forms.html#h-17.12.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With