Question

I have created a dropdown list in cakephp as below :

$city_list = $form->select("GalStore.gal_location_id", $gal_locations,null,$city_attributes); 

Now I needed to send the names of the list in a array, ie in <select name="mylist[]"> format.

I tried to put [] in the above variable :

$city_list = $form->select("GalStore.gal_location_id[]", $gal_locations,null,$city_attributes); 

But its producing HTML as :

<select name="data[GalStore][gal_location_id[]]">

How can I achieve it ?

No correct solution

OTHER TIPS

I am not sure what exactly you are looking for, but this will give you the general idea.

$city_list = $form->select("GalStore.gal_location_id.0", $gal_locations,null,$city_attributes); 
// or
$city_list = $form->select("GalStore.0.gal_location_id", $gal_locations,null,$city_attributes); 

change the 0, as needed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top