HTML Input Box - Disable

后端 未结 5 440
南旧
南旧 2020-12-11 00:13

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

Thanks

相关标签:
5条回答
  • 2020-12-11 00:47
    <input type="text" disabled="disabled" />
    

    See the W3C HTML Specification on the input tag for more information.

    0 讨论(0)
  • 2020-12-11 01:03
    <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.

    0 讨论(0)
  • 2020-12-11 01:03

    The syntax to disable an HTML input is as follows:

    <input type="text" id="input_id" DISABLED />
    
    0 讨论(0)
  • 2020-12-11 01:03
    <input type="text" required="true" value="" readonly>
    

    Not the.

    <input type="text" required="true" value="" readonly="true">
    
    0 讨论(0)
  • 2020-12-11 01:04

    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>
    
    0 讨论(0)
提交回复
热议问题