How to handle errors in forms
Created 5 years ago by dilusha100

I've created a ajax form by following this tutorial -> https://pyrocms.com/help/developer-tools/form-builders/defining-custom-ajax-forms-in-twig. It works perfectly. But my problem is how to send server side errors or validation errors from backend to frontend??

ryanthompson  —  5 years ago

It is included in the JSON response for the form. Here is an example of a generic alert to display errors: https://github.com/anomalylabs/streams-platform/blob/1.5/resources/js/form/ajax.js