HTML5 form required attribute. Set custom validation message?

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

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

14条回答
  •  不知归路
    2020-11-22 01:56

    It's very simple to control custom messages with the help of HTML5 event oninvalid

    Here is code:

    
    

    This is most important:

    onvalid="this.setCustomValidity('')"
    

提交回复
热议问题