-
-
Notifications
You must be signed in to change notification settings - Fork 173
Troubleshooting
After an initial validation, if a field has an error, any further editing of the field will fire a re-validation after every keypress.
This is the default behaviour of jQuery Validation Plugin. You can disable onkeyup event in jsvalidation view
resources/views/vendor/jsvalidation/bootstrap.php
<script>
jQuery(document).ready(function(){
$("<?php echo $validator['selector']; ?>").validate({
errorElement: 'span',
errorClass: 'help-block error-help-block',
onkeyup: false,
Some times Fatal Error Method \Proengsoft\JsValidation\Javascript\JavascriptValidator::__toString()
can occur when view is rendered using __toString() magic method.
<script type="text/javascript" src="{{ asset('vendor/jsvalidation/js/jsvalidation.js')}}"></script>
{!! JsValidator::formRequest('App\Http\Requests\FontUploadRequest') !!}
This happen when occurs any Exception, because [You cannot throw an exception from within a __toString() method. Doing so will result in a fatal error.] (http://php.net/manual/en/language.oop5.magic.php#object.tostring).
To debug your code you can use render() method tho generate Javascript Validations. In this case the exceptions are thrown as usual.
JsValidator::formRequest('App\Http\Requests\FontUploadRequest')->render()
Configure your composer.json
file according Insallation guide.
Publish the javascript assets provided with the package.
php artisan vendor:publish --provider="Proengsoft\JsValidation\JsValidationServiceProvider" --force