© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
vahnmarty

Inserting html to validation message

Just wondering if this is already possible to filament v3?

Currently I'm using Placeholder for this to work

Placeholder::make('email_message')
      ->disableLabel()
      ->content(new HtmlString('This email already exists. <a href="/forgot">Forgot password?</a>')),
Placeholder::make('email_message')
      ->disableLabel()
      ->content(new HtmlString('This email already exists. <a href="/forgot">Forgot password?</a>')),


Is there a way that a $fail can be html?

TextInput::make('email')
      ->label('')
      ->markAsRequired(false)
      ->validationAttribute('email')
      ->placeholder('Email address')
      ->lazy()
      ->autofocus()
      ->required()
      ->rules([
          fn (): Closure => function (string $attribute, $value, Closure $fail) {
              if (!User::where('email', $value)->exists()) {
                  $fail('This email does not exist from our records.');
              }
          },
      ]),
TextInput::make('email')
      ->label('')
      ->markAsRequired(false)
      ->validationAttribute('email')
      ->placeholder('Email address')
      ->lazy()
      ->autofocus()
      ->required()
      ->rules([
          fn (): Closure => function (string $attribute, $value, Closure $fail) {
              if (!User::where('email', $value)->exists()) {
                  $fail('This email does not exist from our records.');
              }
          },
      ]),
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

RichtextEditor inserting HTML
FilamentFFilament / ❓┊help
16mo ago
Validation message
FilamentFFilament / ❓┊help
3y ago
How to translate html validation
FilamentFFilament / ❓┊help
3y ago
Custom validation with HTML
FilamentFFilament / ❓┊help
3y ago