How to submit the value of a disabled input field with HTML?

Spread the love

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 use the readonly attribute.

For instance, we write

<input type="text" readonly="readonly" />

to add a read only input with the readonly attribute.

Read only inputs’ values will be submitted with the form.

Conclusion

To submit the value of a disabled input field with HTML, we use the readonly attribute.

Leave a Reply

Your email address will not be published. Required fields are marked *