How do i combine validator and ajax

i already made the custom validation using validator from adonisjs, but can i combine it with the ajax? would you share the references?

1 Like

Hi @fps

With ajax it works exactly like regular request. There is no difference in it. Just hurl ajax request at API endpoint where validation happens and then check for response code. 4xx will be validation error, while 2xx will be success.

In both cases you can also check for returned data to get validation error messages or success message.

Quite hard to help out more with such a small piece of information :slight_smile: Could be useful if you can show what you tried already