[html] HTML Input Box - Disable

what is the code to disable an INPUT text box for HTML?

Thanks

This question is related to html input

The answer is


<input type="text" required="true" value="" readonly>

Not the.

<input type="text" required="true" value="" readonly="true">

The syntax to disable an HTML input is as follows:

<input type="text" id="input_id" DISABLED />

The syntax to disable an HTML input is as follows:

<input type="text" id="input_id" DISABLED />

You can Use both disabled or readonly attribute of input . Using disable attribute will omit that value at form submit, so if you want that values at submit event make them readonly instead of disable.

<input type="text" readonly> 

or

 <input type="text" disabled>

<input type="text" required="true" value="" readonly="true">

This will make a text box in readonly mode, might be helpful in generating passwords and datepickers.


You can Use both disabled or readonly attribute of input . Using disable attribute will omit that value at form submit, so if you want that values at submit event make them readonly instead of disable.

<input type="text" readonly> 

or

 <input type="text" disabled>

<input type="text" required="true" value="" readonly>

Not the.

<input type="text" required="true" value="" readonly="true">

The syntax to disable an HTML input is as follows:

<input type="text" id="input_id" DISABLED />