Categories
HTML

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

Spread the love

To submit the value of a disabled input field with HTML, we add a hidden field with the name and value attribute values.

For instance, we write

<input type="text" value="22" disabled="disabled" />
<input type="hidden" name="lat" value="22" />

to add a disabled and hidden input with the same name and value attribute values so that the hidden value’s input is submitted.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

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