For a weird reason, I tried rearranging the order of the array of options
from

array_vals=array('1' => 'Active', '0'=>'Inactive');

TO:
array_vals=array('0' => 'Inactive', '1=>'Active');

and added the default value to the element instance and it works fine.

I wanted to make the 'Active' option show first, that's why i was listing it
first.
So I guess the order of the values array options is important on 0/1 values.





maxarbos wrote:
> 
> I have a form that has a select field with two values: 1 and 0.
> 
> <select name="testfield">
>     <option value="1">Yes</option>
>     <option value="0">No</option>
> </select>
> 
> When I submit the form and it is invalid, this select box does not
> remember the value of this field. It always defaults to '1'. There is no
> default value listed in the form builder file.
> 
> All other fields of the form, including the other select fields retain
> their values when there is no '0' value choosen.
> 
> Any advice would be great.
> 
> Thanks.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Form-retain-select-value%3D%220%22-on-invalid-submission-tp18712028p18712988.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to