F
Filament16mo ago
Daniel

Form validation

On registration or login screen (or when using "Filamament Form Builder" standalone on for frontend forms - outside of "Filament Admin Panel") error validation seems to be done by browser itself and not error styling is applied. How can this be changed?
15 Replies
Daniel
Daniel16mo ago
I've noticed that because in case of a required DatePicker I don't get any error notification/highlighting/styling when trying to submit without an value entered.
Daniel
Daniel16mo ago
For my frontend I've done the installation like described here: https://filamentphp.com/docs/2.x/forms/installation
Filament
Installation - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
LeandroFerreira
LeandroFerreira16mo ago
any console error?
Daniel
Daniel16mo ago
no it‘s just the browser validating the required - no css error classes get applied
LeandroFerreira
LeandroFerreira16mo ago
Can you share the code please?
Daniel
Daniel16mo ago
js? php?
LeandroFerreira
LeandroFerreira16mo ago
php If you remove ->required() and add ->rule('required'), what happens when you submit the form?
Daniel
Daniel16mo ago
when making the suggested change the field isn't required any more i share the same fields within the admin panel to have same logic when i want to collect i.e. personal data like "first_name"
Daniel
Daniel16mo ago
in backend:
Daniel
Daniel16mo ago
in frontend:
Daniel
Daniel16mo ago
Daniel
Daniel16mo ago
solved 🙏
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
toeknee
toeknee6mo ago
Open a new topic, just use Required with closure