F
Filament13mo ago
Scott

Validation message

In a Wizard, for one step the select field shows red text with the validation error. For the next step, it shows the pop-up message with the validation error. There isn't any difference in how I set up the Select fields. Any suggestions would be appreciated. Thanks.
No description
No description
Solution:
This is a byproduct of using ->required() vs ->rules(). Required will add the required attribute to the input if it is a native input, meaning it will trigger the browser’s built in validation. Rules will not do this and allow a submission that would be handled by the server and returned as a failure....
Jump to solution
4 Replies
Scott
ScottOP13mo ago
I think the issue has to do with the next action versus the submit action. I think the pop-up validation messages are only triggered for the submit action.
That said, is there a way to make it so that the validation messages are displayed uniformly across these two types of actions? I am working on this now and will post if I figure it out.
Solution
awcodes
awcodes13mo ago
This is a byproduct of using ->required() vs ->rules(). Required will add the required attribute to the input if it is a native input, meaning it will trigger the browser’s built in validation. Rules will not do this and allow a submission that would be handled by the server and returned as a failure.
awcodes
awcodes13mo ago
There’s no right or wrong here. Depends on if you’re worried about extra round trips or not. But the only way to get a unified experience here is to only use rules() for validation.
Scott
ScottOP13mo ago
Awesome, thank you so much.
Want results from more Discord servers?
Add your server