That worked like a champ!

Thanks.



Brenton Alker-3 wrote:
> 
> maxarbos wrote:
>> Hello,
>> 
>> i am building a zend_form that has a select box in it.
>> 
>> The values for the select box come from an array such as:
>> array( 'a' => 'First', 'b' => 'Two');
>> 
>> I want the values and the visible label of the select box to be the
>> values
>> of the array such as:
>> 
>> <option value="First">First</option>
>> <option value="Two">Two</option>
>> 
>> Is there an option or flag to set wen building the select box element to
>> do
>> this, or do I need to iterate through the array and create a new one with
>> the values as the key?
>> 
>> Thanks.
>> 
>> 
> 
> 
> No need to iterate through the array, you can get the array you want by:
> 
> $arr = array('a' => 'First', 'b' => 'Second');
> 
> $arr2 = array_combine($arr, $arr);
> 
> But no, I don't think there is an option on the select box.
> 
> 
> 
>  
> 

-- 
View this message in context: 
http://www.nabble.com/Zend-Form-Select-Box%2C-use-array-values-as-value%3D%22%22-tp21054568p21062065.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to