HTML5 form required attribute. Set custom validation message?

前端 未结 14 1689
你的背包
你的背包 2020-11-22 01:26

I\'ve got the following HTML5 form: http://jsfiddle.net/nfgfP/

14条回答
  •  臣服心动
    2020-11-22 01:49

    Here is the code to handle custom error message in HTML5:

    
    

    This part is important because it hides the error message when the user inputs new data:

    oninput="this.setCustomValidity('')"
    

提交回复
热议问题