Problem with html_options in IE5.2 on MacOSX
| From: | Patrik Bengtsson | Date: | Wed, 11 Dec 2002 18:44:41 +0000 |
| Subject: | Problem with html_options in IE5.2 on MacOSX | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-406@lists.php.net to get a copy of this message | ||
Hi!
I'm using Smarty 2.3.1 and I'm having some problems with the output of html_options see
the following example;
-- In Template-file --
<select name="areacode">
{html_options options=$Areacode selected=$areacode}
</select>
-- In PHP-code --
$Areacode = array('None' => 'Alla', '011' => 'City1',
'0120' => 'City2');
I get the following output;
<select name="areacode" class="text2">
<option label="None" value="None">Alla</option>
<option label="011" value="011">City1</option>
<option label="0120" value="0120">City2</option>
</select>
I belive the output to be wrong shouldn't the 'label' have the text instead of the
key? The dropdown-menu looks good in Mozilla and Windows IE but in IE 5.2 on MacOSX the dropdown
shows the key-value taken from 'label' (Bug in IE on Mac?).
I have changed the following in 'plugins/function.html_options.php' line 46 from;
$html_result = "<option label=\"$key\" value=\"$key\"";
to;
$html_result = "<option label=\"$value\" value=\"$key\"";
Now the result is good in all my browsers..
Is this a bug or have I missed something?
Regards,
/Patrik Bengtsson
Instar Utveckling