Tuesday, March 5, 2013

Setting the "Value" of "Options" in a drop down...

Hello!

Here is what I have in my view:

if($biddetail['Biddetail']['Sold'] == 'SOLD'){$otherstate = 'OPEN';} else {$otherstate = 'SOLD';}
echo $this->Form->input('Sold', array('options' => array($otherstate),'empty' => $biddetail['Biddetail']['Sold']));

Is there no way to set the value to equal to the option?  ie  value = 'SOLD' rather than value = '0'.  As you can see above the values change based on the current value populated in the data base...

I don't want to have to go back and add a table to hold two values that will never change.  Any solutions?  I have already read the documentation at:
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html  which does not provide a solution for this question.


Thanks!!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: