the code in my views folder views/posts/index.thtml
CODE
<?php
//echo var $tags = array('selectstart');
foreach ($posts as $post):
echo $form->select('chuvaness', array('id'=>$post['Post']['id']),null,null,false);
endforeach;
//echo var $tags = array('selectend');
?>
the code in my post controller
CODE
<?php
class PostsController extends AppController
{
var $name = 'Posts';
function index()
{
$this->set('posts', $this->Post->find('all'));
}
}
?>
my code displays many dropdown depending on how many the rows my table have,,
currently it have 3 ,so it displays 3 dropwdowns, each dropdown option value = each row..
example,,
rows are , 1.anna ,, 2.mary ,,3.john
dropdowns would be,
dropdown1 = anna
dropdown2= mary
dropdown3=john
which is incorrect because what im trying to do is to display one dropdown having 3 options value,
please,,im stuck here,, can anyone help me here,, thank you in advance...