Love Fuel?
Donate
About
Forums
Discussions
Login
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
set fieldset select option selected
legacy_warrior
June 2017
how can we set an <option> in fuelphp Fieldset <select> to be selected?
or at least replace that field with manually created html?
WanWizard
June 2017
Accepted Answer
How do you create the fieldset? Manually? Or from an ORM model?
In general, it uses the current value of the fieldset field as the selected option in case of a dropdown.
WanWizard
June 2017
Accepted Answer
A snippet from one of our apps (manually created fieldset):
$options = \DB::select('id', array(\DB::expr('CONCAT(surname,", ",initials," ",prefix)'), 'name'))
->from('people')
->where('client_id', '=', $client_id)
->order_by('name', 'ASC')
->execute()
->as_array('id', 'name');
$fieldset->field('contact_id')
->set_options($options)
->set_value($contact_id);
legacy_warrior
June 2017
>>
In general, it uses the current value of the fieldset field as the selected option in case of a dropdown.
>>
->set_value($contact_id);
awesome, exactly what i was looking for, thank you!
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,090
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
262
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
legacy_warrior
June 2017
WanWizard
June 2017
To Top