validationMessages within createOptionsFrom not working as expected
Hi All,
this produces the screenshot with orange ! icon, I'd expect it to show with red text like the other screenshot!? Any ideas?
Cheers, Bot


Solution:Jump to solution
@awcodes, We have managed to work this one out:
```php
TextInput::make('name')
->label('Job Title')...
6 Replies
This is the default browser validation. If you do not want to use it then drop required() and maxLength() and apply them with rules()
@awcodes I'm chiming in as Bot's colleague... can you point to an example/resource of this for required so we can get an idea of implementation please?
Solution
@awcodes, We have managed to work this one out:
when you use ->required() it also adds the 'required' attribute to the input, which will trigger browser validation. It's useful to prevent unnecesary requests to the server.
->rules() allows you to pass in a laravel validation rule set that will only get run when a request is made.
appreciate it, understood!
you can also do this like this:
->rules(['required', 'max:255'])