open-admin icon indicating copy to clipboard operation
open-admin copied to clipboard

Display Error message on form submit for required fields

Open AndreasMySch opened this issue 1 year ago • 2 comments

Is there a default "display error on form() submit" method that I can use? Or should this be built in manually? I have added "->required()" to the form fields in my form() function to show the required asterisk "*". At the moment, when leaving the field marked "required()" empty and trying to submit only this shows in the console "Form still has errors" from the open-admin-form.js file.

AndreasMySch avatar Feb 13 '24 12:02 AndreasMySch

You can use a hook to provide custom validation and a response you can set validation rules

Please refer to the documentation regarding Form callback and Form validation

RCyrix avatar Feb 15 '24 08:02 RCyrix

$form->html()

optiktr avatar Dec 06 '24 14:12 optiktr