Laravel 5: Best way to validate form with Javascript

前端 未结 4 755
野趣味
野趣味 2021-01-04 09:05

I want to validate forms in the client side in Laravel. It\'s there any easy way to do it?

4条回答
  •  长发绾君心
    2021-01-04 09:37

    As discussed in the comments, since Laravel is a backend framework, it does not provide client side validation out of the box.
    It shouldn't.

    You might choose a Javascript framework such as Angularjs, emberjs, etc. that will have validation baked in.
    Or if you're using jQuery, you can just use any jquery validation plugin, here are a few:

    • http://formvalidation.io/
    • http://jqueryvalidation.org/
    • https://github.com/jzaefferer/jquery-validation

    if you're using bootstrap, then you can use http://1000hz.github.io/bootstrap-validator/

提交回复
热议问题