Setting the default value of a TextInput within a Repeater
Hello, I'm trying to set the default value of TextInput within a Repeater using another field outside this repeater.
This is a simplified example of what I'm doing, unfortunately I'm not getting the value of cap field.
Any suggestions?
public static function form(Form $form): Form
{
return $form
->schema([
HiddenInput::make('cap'),
Repeater::make('numbers')
->schema([
TextInput::make('prefix')->default(fn (Get $get) => $get('../../cap')), // I will add a query that will use the value to retrieve data from DB
])
]);
}
This is a simplified example of what I'm doing, unfortunately I'm not getting the value of cap field.
Any suggestions?
public static function form(Form $form): Form
{
return $form
->schema([
HiddenInput::make('cap'),
Repeater::make('numbers')
->schema([
TextInput::make('prefix')->default(fn (Get $get) => $get('../../cap')), // I will add a query that will use the value to retrieve data from DB
])
]);
}