Skip to content Skip to sidebar Skip to footer

HTML Input Field Disable Input But Still POST

Basically i want a disable text field to show the value stored in a database but i don't want it to be editable by the user. i've tried using disabled='disabled' but then it no lon

Solution 1:

If you insist on using a disabled field, you can enable it during form submission by handling the form onsubmit event, where you will enable the field and submit the form.

A second option would be to use a readonly field which you may cleverly make look as disabled via CSS.

A third option would be to use a disabled and a hidden field. Rename your disabled field to something irrelevant and use the original field's name for the hidden one.

Take your pick.


Post a Comment for "HTML Input Field Disable Input But Still POST"