Naren
Naren
FFilament
Created by Miguel García on 10/11/2023 in #❓┊help
'Create' - 'Create & create another' validation
I managed to find a solution to the issue. By adding the novalidate attribute to the form tag, I was able to bypass the default HTML form validation.
13 replies
FFilament
Created by Miguel García on 10/11/2023 in #❓┊help
'Create' - 'Create & create another' validation
Hi, I've encountered a similar issue when implementing a form within a Livewire component. The 'Create' button seems to trigger the default HTML form validation. Has anyone found a way to specify whether to use client-side (local) validation or server-side validation within Livewire?"
13 replies
FFilament
Created by Naren on 7/2/2023 in #❓┊help
Hidden attribute not working as expected for Sections in Filament Form
Yes this one working fine
Forms\Components\Section::make('Contract')
->relationship('contract')
->hidden(function (\Closure $get) {
return $get('employment.employee_type_id') != 3;
})
->reactive()
->schema([
Forms\Components\DatePicker::make('start_date'),
Forms\Components\DatePicker::make('end_date'),
Forms\Components\TextArea::make('terms')->columnSpan('full'),
])
->columns(2),
Forms\Components\Section::make('Contract')
->relationship('contract')
->hidden(function (\Closure $get) {
return $get('employment.employee_type_id') != 3;
})
->reactive()
->schema([
Forms\Components\DatePicker::make('start_date'),
Forms\Components\DatePicker::make('end_date'),
Forms\Components\TextArea::make('terms')->columnSpan('full'),
])
->columns(2),
Thank you for your support
16 replies
FFilament
Created by Naren on 7/2/2023 in #❓┊help
Hidden attribute not working as expected for Sections in Filament Form
Forms\Components\Section::make('Employment')
->relationship('employment')
->reactive()
->schema([

Forms\Components\Select::make('employee_type_id')
->reactive()
->relationship('employeeType', 'name')


])
->columns(2),

Forms\Components\Section::make('Contract')
->relationship('contract')
->reactive()
->hidden(function (Closure $get) {
return $get('employee_type_id') != 3;
})
->schema([
Forms\Components\DatePicker::make('start_date'),
Forms\Components\DatePicker::make('end_date'),
Forms\Components\TextArea::make('terms')->columnSpan('full'),
])
->columns(2),
Forms\Components\Section::make('Employment')
->relationship('employment')
->reactive()
->schema([

Forms\Components\Select::make('employee_type_id')
->reactive()
->relationship('employeeType', 'name')


])
->columns(2),

Forms\Components\Section::make('Contract')
->relationship('contract')
->reactive()
->hidden(function (Closure $get) {
return $get('employee_type_id') != 3;
})
->schema([
Forms\Components\DatePicker::make('start_date'),
Forms\Components\DatePicker::make('end_date'),
Forms\Components\TextArea::make('terms')->columnSpan('full'),
])
->columns(2),
I tried != 3 it's not working
16 replies
FFilament
Created by Naren on 6/20/2023 in #❓┊help
Updating parent form state from a child component in Filament's Repeater
10 replies
FFilament
Created by Naren on 6/20/2023 in #❓┊help
Updating parent form state from a child component in Filament's Repeater
10 replies
FFilament
Created by Naren on 6/20/2023 in #❓┊help
Updating parent form state from a child component in Filament's Repeater
Thank you for your help. After testing your suggestion further, I found that by using $set('../../days_taken', 1), I'm able to traverse the structure and successfully update the state of the parent component from within the child component. This solution works perfectly for my use case. Thank you again for your valuable input. Your assistance helped me resolve the issue.
10 replies
FFilament
Created by Naren on 6/20/2023 in #❓┊help
Updating parent form state from a child component in Filament's Repeater
Thank you for your suggestion. I tried using $set('../../../days_taken') to traverse the structure, but unfortunately, it doesn't seem to work in this case. The $set function doesn't seem to affect the state of fields outside the current component scope. Is there another way to update the state of a parent component from within a child component in Filament? I would appreciate any alternative approaches or workarounds you might suggest.
10 replies