HTML5 form required attribute. Set custom validation message?

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

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

14条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 01:42

    By setting and unsetting the setCustomValidity in the right time, the validation message will work flawlessly.

    
    

    I used onchange instead of oninput which is more general and occurs when the value is changed in any condition even through JavaScript.

提交回复
热议问题