smarty
smarty

Reputation: 51

Add more output smarty html option

{html_options values=$row.milestone_id output=$row.title output=$row.title}

hi folks,how to add more $output in smarty html option ?

Upvotes: 0

Views: 1017

Answers (1)

mike
mike

Reputation: 5223

The output needs to be an array to populate the dropdown. See the example

PHP code

$smarty->assign('myOptions', array(
                                1800 => 'Joe Schmoe',
                                9904 => 'Jack Smith',
                                2003 => 'Charlie Brown')
                                );
$smarty->assign('mySelect', 9904);

Then the template

{html_options name=foo options=$myOptions selected=$mySelect}

And the output

<select name="foo">
<option label="Joe Schmoe" value="1800">Joe Schmoe</option>
<option label="Jack Smith" value="9904" selected="selected">Jack Smith</option>
<option label="Charlie Brown" value="2003">Charlie Brown</option>
</select>

Upvotes: 1

Related Questions