html5 required and jQuery submit()

后端 未结 9 613
我在风中等你
我在风中等你 2020-12-09 07:56

I\'m trying to implement html5 into a form, but I came with a problem when I submit the form through jquery and try to use the html5 \"required\" attribute.

Here is

9条回答
  •  半阙折子戏
    2020-12-09 08:57

    You can

    • trigger click event on a submit
    • check validation manually with $("form")[0].checkValidity()
    • find invalid elements manually using $("form :invalid")

提交回复
热议问题