jQuery validation plugin not validating the fields onblur and onkeyup

I am using jQuery validation plugin to validate the form data. It works fine on form submit. But `onkeyup` and `onblur` it is not working. jQuery code: --------------- var validator = $("#myForm").validate( { rules:{ attribute: "required", attributeValue: "required email" }, messages:{ attribute: "Required", attributeValue: { required: "Enter email", email: "Enter valid email" } } }); Am I doing anything wrong here?
Assuming your .validate() is wrapped inside a DOM ready event hander, there is nothing wrong with your code, and the plugin will validate onfocusout and onkeyup by default. Perhaps you should consider using a newer version of jQuery than 1.5.2, since you're using v1.11 of the plugin. See: jsfiddle.net/rfKaE

以上就是jQuery validation plugin not validating the fields onblur and onkeyup的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏