HTML required readonly input in form

后端 未结 13 2054
执笔经年
执笔经年 2020-12-13 08:36

I\'m making a form. And on one input tag is an OnClick event handler, which is opening a popup, where you can choose some stuff, and then it autofi

13条回答
  •  無奈伤痛
    2020-12-13 09:21

    Required and readonly don't work together.

    But readonly can be replaced with following construction:

         
    

    1) onkeydown will stop manipulation with data

    2) style="caret-color: transparent !important;" will hide cursor.

    3) you can add style="pointer-events: none;" if you don't have any events on your input, but it was not my case, because I used a Month Picker. My Month picker is showing a dialog on click.

提交回复
热议问题