mercredi 5 août 2015

Select box doesn't work


So I have a select box built with :

$form->addElement(new Element\Select("Existing projects:", "Existing_Projects", $options, array("onchange"=>"this.form.submit()")));

And here is the code to get the projects.But somehow it doesn't work.When I click on 'option2' option,it gets back to 'option1'.

$projects = get_projects();
$options = array();
foreach ($projects as $project){
    if ( $project[2] == $Existing_Projects )
        $option = $project ; break ;
    array_push($options, $project[1]);
    }
$options = array(10=>"option1",5=>"option2", "value"=>"selected", 6=>"option3");
//print_r($options);
$form = new Form("project-form");//"prevent" => array("bootstrap", "jQuery"),
$form->configure(array(
    "action" => "right.php?target=management/platform"
));

What is wrong?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire