Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Is there ability to set empty value for select option?
  • 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.


  • HarroHarro
    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.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion