Re: [Phplib-users] oohforms, default setting in multiple select box
Brought to you by:
nhruby,
richardarcher
|
From: Mikhail A. <ma...@lb...> - 2002-04-12 00:57:08
|
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
>
|