简体   繁体   English

如何使用jQuery验证Laravel验证规则

[英]How to validate laravel validation rules using jquery

I have been searching to find a good working plugin for jquery validation for laravel which should use the laravel rules defined in ForRequest or Controller. 我一直在寻找找到一个好的工作插件来对laravel进行jquery验证,该插件应使用ForRequest或Controller中定义的laravel规则。 But could not find any working one. 但找不到任何可行的方法。

I tried "laravel-jsvalidation" but not working fine. 我尝试了“ laravel-jsvalidation”,但无法正常工作。 It submits the form even if empty field error showing. 即使显示空字段错误,它也会提交表单。

Also tried parsley and then parsley extra (which they say supports laravel rules) but not working. 还尝试了香菜,然后再进行香菜(他们说这支持laravel规则),但是不起作用。

Can anyone please suggest me a good plugin already made. 谁能建议我一个已经制作好的插件。

THANKS Faysal 感谢Faysal

Maybe this package do the trick for you. 也许此软件包可以帮您解决问题。 Works with Parsley and formvalidation, and use moment.js for properly manage date validations. 与Parsley和formvalidation一起使用,并使用moment.js正确管理日期验证。

https://github.com/dragonFlyAdmin/nag https://github.com/dragonFlyAdmin/nag

This package converts FormRequest rules to inline data attributes in your forms. 该程序包将FormRequest规则转换为表单中的内联数据属性。

Both Parsley and formvalidation.io take these data attributes to handle front-end validation. Parsley和formvalidation.io都使用这些数据属性来处理前端验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM