Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Vue/blade selectGroup

Don Cranford   ( User )

Commented 4 years ago

How do you make a field not required when using the Form::selectGroup()?

My current attempt is:

{{ Form::selectGroup('account_id',
trans('doc-manager::general.account'),
'bars',
$accountsList,
old('account_id', $doc->account_id)),
['required' => 'false']
}}

I've tried setting 'required' => null, 'required' => false, 'required' => 'false' as well as leaving it blank, but it still sets it as required.

Thanks

Sevan Nerse   ( User )

Commented 4 years ago

You should send empty array like below.

{{ Form::selectGroup('account_id',
trans('doc-manager::general.account'),
'bars',
$accountsList,
old('account_id', $doc->account_id)),
[]
}}

Don Cranford   ( User )

Commented 4 years ago

Thanks. I tried that but it still shows as required.

Don Cranford   ( User )

Commented 4 years ago

It does not seem to matter what I put there. It only accepts the values set in App\Providers\Form for Facade::component('selectGroup'...). Maybe I'm doing something wrong, but I can't tell that I am.

Please login or register to leave a response.

Showing 1 to 4 of 4 discussions