Smarty possible Bug with html_option

From: Date: Wed, 01 Aug 2001 16:43:03 +0000
Subject: Smarty possible Bug with html_option
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1305@lists.php.net to get a copy of this message
Hello, I think there is a bug in Smarty "html_options" but i m not sure so i need your confirmation ;) It seems that when the value is ==0 the selected option goes to the first value different of 0. For example : {html_options values=$tab_ON_Value selected=$tab_ON_Select output=$tab_ON} PHP : $tab_ON=array("NON","OUI"); $tab_ON_value=array("0","1"); $tab_ON_select=array("1",""); $T->assign("tab_ON",$tab_ON); $T->assign("tab_ON_Value",$tab_ON_value); $T->assign("tab_ON_Select",$tab_ON_select); Should Give : <option value="0" selected>NON</option> <option value="1" >OUI</option> But here it gives : <option value="0">NON</option> <option value="1" selected>OUI</option> Like Smarty affects the selected value with the value ... To show that there is a problem this code is workong fine : $tab_ON=array("NON","OUI"); $tab_ON_value=array("1","0"); $tab_ON_select=array("1",""); $T->assign("tab_ON",$tab_ON); $T->assign("tab_ON_Value",$tab_ON_value); $T->assign("tab_ON_Select",$tab_ON_select); it gives : <option value="1" selected>NON</option> <option value="0" >OUI</option> So i think smarty is bugging when the value is 0 and the SELECTED is ON. What do u think ? ______________________________________ Cordialement, Martin DUBUC mailto:dubucm@wawawoom.com

« previous php.smarty.general (#1305) next »