Hi... I am having a problem with Dojo combobox and i was hoping that you
could help me...
the forms setup is like this:
$video = new Zend_Dojo_Form_Element_ComboBox('video_ID');
$video->addMultiOption('test', '1')
->setAutocomplete(true)
->setLabel('Video');
and I was expecting when i was selecting option 1 to have the value "test"
posted.
instead i get posted the value 1.
any clues why is that happening?
Jeroen Keppens wrote:
>
> Ok, just found this after re-reading the docs:
>
> "ComboBoxes return the label values
> ComboBoxes return the label values, and not the option values, which can
> lead to a disconnect in expectations. For this reason, ComboBoxes do not
> auto-register an InArray validator (though FilteringSelects do)."
>
> Please disregard my previous mail ;)
>
> Jeroen
>
>
> Jeroen Keppens wrote:
>>
>> Hi,
>>
>> I have a form with a combobox, I've set it up like this (class extends
>> Zend_Dojo_Form) :
>>
>> $country = $this->createElement('ComboBox', 'country')
>> ->setLabel('lbl_country')
>> ->setAutoComplete(true)
>> ->setMultiOptions($this->getCountryList()))
>> ->setRequired(true);
>>
>> The country list gives an associative array that looks like:
>>
>> array(
>> "af"=>"Afghanistan",
>> "al"=>"Albania",
>> "dz"=>"Algeria",
>> ...
>> );
>>
>> The combobox is shown correctly, autocompletion works, etc... In the
>> html source I see:
>>
>> <select name="country" id="country">
>> <option value="af" label="Afghanistan">Afghanistan</option>
>> <option value="al" label="Albania">Albania</option>
>> <option value="dz" label="Algeria">Algeria</option>
>> ...
>> </select>
>>
>> When I submit the form, I don't get the short value in $_POST, but the
>> long value:
>>
>> $_POST = array('country'=>'Albania');
>>
>> How can I get the short value "al" in the POST array instead of the long
>> value?
>>
>> Tnx
>> Jeroen
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Dojo-%3A-ComboBox-%3A-POST-value-tp21531598p22596544.html
Sent from the Zend Framework mailing list archive at Nabble.com.