can someone help me how to use JSvalidator like proengsoft/laravel-jsvalidation in backpack. I know that you can edit the request rules for validation, but thats not what i want. I want a field to be validated onchange, onkeyup and etc. and jsValidator libraries can help me big, instead of doing it manually. thank You in Advance
1 Answers
1
votes
This is kind of a hack... but it works. What I did when I needed extra JS in my operations (in your case Create&Update) is that I created a Backpack Widget that will include the extra JS I need. And then I use that widget on those operations. This translates to something like a product_validation.php file:
@push('after_scripts')
<script>
// your custom code here
</script>
@endpush
and then doing:
public function setupCreateOperation() {
Widget::add()
->to('after_content')
->type('product_validation')
->content(null);
}