views:

408

answers:

1

hi, this is the dropdown list link in my edit page when editing it selects the friend automatically, but i want it shows 'select your exiting friend' by default(whenever the page loads)..

echo $form->input('PostCard.friend_id',array('label'=>_l('Friend Name List'),'empty'=>_l('Select Your Existing Friend'),'options'=>$friends));

+2  A: 

You can override selected value: http://book.cakephp.org/view/199/options-selected

echo $form->input('PostCard.friend_id',array('label'=>_l('Friend Name List'),'empty'=>_l('Select Your Existing Friend'),'options'=>$friends, 'selected'=>false));
harpax