[PHPLIB] default values: oohforms & select multiple From: Bob Strouper (bobw123 <email protected>)
Date: 11/14/99

Hello,

How do I set the default values for a multiple
select list? Is this possible or do I have to go
in and extend the class?

For some reason the following will not work:

$o = array(array("label"=>"Select the number of images you will
upload","value"=>0),
array("label"=>"one","value"=>1),
array("label"=>"two","value"=>2),
array("label"=>"three","value"=>3),
array("label"=>"four","value"=>4),
array("label"=>"five","value"=>5));

$f->add_element(array("type"=>"select",
"name"=>"image_menu",
"options"=>$o,
"multiple"=>1,
"size"=>5,
"value" => "3"));

This won't set 3 as the default on load of this
element. There must be a way to do this since
if an error is made, load_defaults() repaints the form
with previously "selected" options.

Can somone please tell me what stupid mistake I am making
here.

Please show me how I can load the above form element
with and array of options selected... one(1) and five(5)
for example.

Thanks
Bob

__________________________________________________
FREE Email for ALL! Sign up at http://www.mail.com

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.