F
Filament4mo ago
Enas

Delete hover text

Hello dears, How can I delete the text when I hover on field form in filament? Your kind support is highly appreciate.
No description
No description
Solution:
As Dennis said, ->rules([‘required’]) instead of ->required()
Jump to solution
11 Replies
Andi
Andi4mo ago
This comes from ->required() as it will add required attribute to your html tag.
Enas
EnasOP4mo ago
Well, so how can I disable or customize them?
toeknee
toeknee4mo ago
It's provided by the browser You can set the 'title' on the attribute to change it
Enas
EnasOP4mo ago
@toeknee Thank you, please can you give me an example how to set the title?
toeknee
toeknee4mo ago
->extraAlpineAttributes(['title' => 'my test'])
->extraAlpineAttributes(['title' => 'my test'])
Dennis Koch
Dennis Koch4mo ago
I don't think the title affects the browser validation As Andi pointed out, this is comes from ->required() because we use HTML attributes for browser validation. In this case you can apply ->rules(['required']) to only apple the rule without the HTML required attribute.
LeandroFerreira
LeandroFerreira4mo ago
or this if you want to customize this title
->extraInputAttributes([
'oninvalid' => 'this.setCustomValidity(\'Custom title\')',
'oninput' => 'this.setCustomValidity(\'\')',
])
->extraInputAttributes([
'oninvalid' => 'this.setCustomValidity(\'Custom title\')',
'oninput' => 'this.setCustomValidity(\'\')',
])
Enas
EnasOP4mo ago
Thanks to all, now I still have 2 validations like image below, So I want only the error message in red without the box. Is this possible in filament?
No description
toeknee
toeknee4mo ago
The box is added by your browser.... But if you add novalidate to the form it would resolve it. So actually as a hacky method try within the builder per field:
->extraAlpineAttributes([
'oninvalid' => "this.setCustomValidity(' ')",
' oninput' => "this.setCustomValidity('')",
])
->extraAlpineAttributes([
'oninvalid' => "this.setCustomValidity(' ')",
' oninput' => "this.setCustomValidity('')",
])
or on the ->form its self:
->extraAlpineAttributes(['novalidate' => ''])
->extraAlpineAttributes(['novalidate' => ''])
Solution
awcodes
awcodes4mo ago
As Dennis said, ->rules([‘required’]) instead of ->required()
Enas
EnasOP4mo ago
Thank you all, it works now 😃
Want results from more Discord servers?
Add your server