Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Orm
Is there ability to set empty value for select option?
daminate
December 2012
Trying to have a select field in my fieldset that has an empty valued option.., ie:
array(''=>'--Choose One--','val1'=>'Value 1','val2'=>'Value 2');
fieldset handler always seems to render the options omitting the value attribute if the value is an empty string, which causes default html form behavior to take the option label as the value which is way undesired.
Harro
December 2012
Accepted Answer
That was a bug in the array_to_attr() helper function (which is in fuel/core/base.php), which is fixed in 1.5/develop.
See
https://github.com/fuel/core/commit/dfe71da5da48557c33c3c21f484f716649144ce1
if you don't want to move your app to 1.5/develop, you can apply it to the version you're using.
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,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
December 2012