F
Filament3mo 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
Andi3mo ago
This comes from ->required() as it will add required attribute to your html tag.
Enas
Enas3mo ago
Well, so how can I disable or customize them?
toeknee
toeknee3mo ago
It's provided by the browser You can set the 'title' on the attribute to change it
Enas
Enas3mo ago
@toeknee Thank you, please can you give me an example how to set the title?
toeknee
toeknee3mo ago
->extraAlpineAttributes(['title' => 'my test'])
->extraAlpineAttributes(['title' => 'my test'])
Dennis Koch
Dennis Koch3mo 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
LeandroFerreira3mo 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
Enas3mo 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
toeknee3mo 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
awcodes3mo ago
As Dennis said, ->rules([‘required’]) instead of ->required()
Enas
Enas3mo ago
Thank you all, it works now 😃
Want results from more Discord servers?
Add your server