mask removed on form submit
The mask is removed after the form is submitted. How can I ensure it's persisted?
TextInput::make('ein')->label('EIN')
->required()
->rules('max:10,min:10')
->mask('99-9999999')
->formatStateUsing(function (string $state) {
if (strlen($state) === 9 && ctype_digit($state)) {
// Insert a hyphen after the second digit
return substr_replace($state, '-', 2, 0);
}
return $state;
})
TextInput::make('ein')->label('EIN')
->required()
->rules('max:10,min:10')
->mask('99-9999999')
->formatStateUsing(function (string $state) {
if (strlen($state) === 9 && ctype_digit($state)) {
// Insert a hyphen after the second digit
return substr_replace($state, '-', 2, 0);
}
return $state;
})
0 Replies