Hello, i'm having problems with FormTagHelper::select_tag() function. The 3rd parameter is supposed to be an array with options such 'multiple', 'include_blank' and so forth.. i need to have an empty option as first choice, but when i setup an options array with "include_blank" => true nothing happens. In HTML i see that an attribute include_blank is added to select tag, which is obviously not the correct behaviuor, but i think i'm doing nothing wrong (according to WIKI documentation). Does anybody have the same problem? Thanks!
Here's a snippet of my code, cleaned a bit for clarity.
$html_select_options = array('prompt' => '- Select -');
$select_options = array('selected' => array($job_phase->phase_id));
echo $form_options_helper->select('cust[job_phases]', 'phase_id', $array_to_pick, $select_options, $html_select_options );
Does that help?
Thanks for your reply, suthern.. In fact i tried your code and had the same problem.. here's the select declaration i get in the HTML:
select prompt="- Select -" name="user[role_id]" id="user_role_id">
Does that code work for you?
Hi gizmo,
The 3rd parameter of that function is used only to set up html options for the select tag. These will end up 1:1 in the HTML, right as you pass them in.
I think you have to include your blank option manually, or use FormOptionsHelper::select() instead.
1 to 4 of 4