Re: Smarty possible Bug with html_option

From: Date: Wed, 01 Aug 2001 16:57:14 +0000
Subject: Re: Smarty possible Bug with html_option
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1306@lists.php.net to get a copy of this message
Woh sorry .... after looking the function smarty_func_html_options() i've understand that to select something u have to put his value in the select tab .... So for me it was : MD> $tab_ON=array("NON","OUI"); MD> $tab_ON_value=array("0","1"); MD> $tab_ON_select=array("0",""); and not : MD> $tab_ON=array("NON","OUI"); MD> $tab_ON_value=array("0","1"); MD> $tab_ON_select=array("1",""); Sorry again ;) Keep up the good work >MD> Hello, MD> I think there is a bug in Smarty "html_options" but i m not sure so i MD> need your confirmation ;) MD> It seems that when the value is ==0 the selected option goes to the MD> first value different of 0. MD> For example : MD> {html_options values=$tab_ON_Value selected=$tab_ON_Select output=$tab_ON} MD> PHP : MD> $tab_ON=array("NON","OUI"); MD> $tab_ON_value=array("0","1"); MD> $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); MD> Should Give : MD> <option value="0" selected>NON</option> MD> <option value="1" >OUI</option> MD> But here it gives : MD> <option value="0">NON</option> MD> <option value="1" selected>OUI</option> MD> Like Smarty affects the selected value with the value ... MD> To show that there is a problem this code is workong fine : MD> $tab_ON=array("NON","OUI"); MD> $tab_ON_value=array("1","0"); MD> $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); MD> it gives : MD> <option value="1" selected>NON</option> MD> <option value="0" >OUI</option> MD> So i think smarty is bugging when the value is 0 and the SELECTED is MD> ON. MD> What do u think ? MD> ______________________________________ MD> Cordialement, MD> Martin DUBUC mailto:dubucm@wawawoom.com MD> --- MD> You are currently subscribed to smarty as: dubucm@flash-france.com MD> To unsubscribe send a blank email to $subst('Email.Unsub') MD> Visit Smarty's homepage at MD> http://www.phpinsider.com/php/code/Smarty/ ______________________________________ Cordialement, Martin DUBUC mailto:dubucm@wawawoom.com

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