Sometimes, we want to submit the value of a disabled input field with HTML.
In this article, we’ll look at how to submit the value of a disabled input field with HTML.
How to submit the value of a disabled input field with HTML?
To submit the value of a disabled input field with HTML, we replace the disabled attribute with the readonly attribute.
For instance, we write
<input type="text" readonly="readonly" />
to set the readonly attribute to readonly.
This way, the user won’t be able to interact with the input, but the input value will still be submitted.
Conclusion
To submit the value of a disabled input field with HTML, we replace the disabled attribute with the readonly attribute.