Marcin Dobrucki <Marcin.Dobrucki@TAKETHISAWAY.nokia.com> pipotte et a dit :
[color=blue]
> I am trying to get a default value set for a "Select" element, like this:
>
> $f = new HTML_QuickForm("request", "post", "", "_self", NULL,TRUE);
> $f_priority = array ("Very low","Low","Normal","High","Very High");
> $priority_element =& $f->addElement("select", "request_priority",
> "Priority:", $f_priority);
> $priority_element->setSelected("2");
> ...
>
> But the html which is generated from this looks like this:
>
> ...
> <option value="1">Low</option>
> <option value="2" selected="selected">Normal</option>
> <option value="3">High</option
> ...
>
> To my understanding, it should only say "selected", not "selected="selected"
>
> Is there some workaround, am I doing something wrong, or does one need
> to hack QuickForm for this?
>[/color]
The valid XHTML syntax is <option selected="selected"
http://www.w3schools.com/xhtml/xhtml_syntax.asp
--
Julien CROUZET aka c2c Promo 2007[color=blue][color=green]
>> Suivi: Une operation de maintenance va necessiter d'interrompre gate-nat
>> Suivi: momentanement. Duree de l'operatin evaluee a 15 minutes.[/color]
> Suivi: Intervention terminee. Duree reelle de l'intervention: 30 minutes.[/color]
badi