html5 required and jQuery submit()

后端 未结 9 618
我在风中等你
我在风中等你 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:35

    You are right. HTML5 validation works only when submit is triggered by user. this is how it is. :(

    you need write a your own custom method on submit. OR there is a good plugin you can use which validates fields according html5 attributes.

    here is the plugin link

提交回复
热议问题