How can I create a custom message when an HTML5 required input pattern does not pass?

前端 未结 8 942
伪装坚强ぢ
伪装坚强ぢ 2021-02-01 04:08

I have the following:



        
8条回答
  •  别跟我提以往
    2021-02-01 04:22

    I'd add another attribute oninvalid.

    oninvalid="setCustomValidity('Please enter at least 5 characters')"

    
    

提交回复
热议问题