Re: [Phplib-users] oohforms, default setting in multiple select box
Brought to you by:
nhruby,
richardarcher
|
From: Peter T. <pte...@te...> - 2002-04-12 19:17:24
|
Mikhail, Tarique,
Thanks for your response! Problem solved. I overlooked the 'array'-type
in the "value". Got it working now.
Thanks again,
Peter
At 02:57 12-04-2002, Mikhail Avrekh wrote:
>This works:
>
><?
>
>$form = new form;
>$form->start();
>$form->add_element(
> array("name"=>"editor",
> "type"=>"select",
> "value"=>array("editor"),
> "multiple"=>"3",
> "options"=>array(
>
>array("label"=>"Administrator","value"=>"admin"),
> array("label"=>"Editor","value"=>"editor"),
> array("label"=>"User","value"=>"user")
> )
> )
> );
>$form->show_element("editor");
>$form->finish();
>
>?>
>
>If you want more than one option selected, try
>
>"value"=>array("editor","user",....)
>
>M.
>
>On Fri, 12 Apr 2002, Peter Termaten wrote:
>
> > Hi folks,
> >
> > I' want to tell oohforms to display one of values in a multiple select box
> > as the default.
> >
> > In plain HTML:
> >
> > SELECT ID=privbox NAME=box[] SIZE=3 MULTIPLE>
> > <OPTION VALUE='admin'>admin</OPTION>
> > <OPTION VALUE='editor' SELECTED>editor</OPTION>
> > <OPTION VALUE='user'>user</OPTION></SELECT>
> >
> > In this case 'editor' will be highlighted and accepted as default value.
> >
> > How can achieve this with oohforms?
> > I have tried to use "value" in add_element and $value as second parameter
> > in show_element but that doesn't seem to have the effect I want.
> > Documentation doesn't clarify much.
> >
> > Any ideas are welcome
> >
> > Cheers,
> > Peter
> >
> >
> > _______________________________________________
> > Phplib-users mailing list
> > Php...@li...
> > https://lists.sourceforge.net/lists/listinfo/phplib-users
> >
----------
TERIS Information Services BV
Peter Termaten Phone: +31 23 565 2682
Aagje Dekenstraat 43 Fax: +31 23 565 2676
2135 RJ Hoofddorp Mobile: +31 653 65 8686
www.teris.nl
----------
|