From: Alexander M. <am...@si...> - 2003-03-27 11:48:40
Hi...
can someone tell me how to get da value of an select field selected ?
i create the Options like this:
while ($db->next_record()){
array_push($options,
array("label"=>"".$db->f('name')."","".$db->f('id').""));
}
The Select is created like this:
$f->ae(array("type" => "select", "name" => "land", "options"=>$o));
How can i get one of the options selected (which comes out of the database)?
Thanks
Alex
From: Marko K. <M.K...@os...> - 2003-03-27 13:24:36
Hi,
look here:
$o = array(array('label'=>'Please Select a Fruit','value'=>0),
array('label'=>'Apple','value'=>1),
array('label'=>'Orange','value'=>2),
array('label'=>'Pear','value'=>3),
array('label'=>'Grape','value'=>4));
$f->add_element(array('type'=>'select',
'name'=>'menu',
'options'=>$o,
'size'=>3,
'valid_e'=>'Please select a fruit',
'value'=>1));
This will select the 'Apple'!!!
Marko