Custom form validation

Yes, you’d use a JSON response containing an error property. <?php echo json_encode( [ ‘error’ => [ ‘code’ => ‘my_error_code’, ‘message’ => ‘My error message.’, ‘data’ => [any additional data you need], ], ] ); Your AJAX callback should look for the error and adapt accordingly. For the regular POST, you’d want to generate HTML … Read more