Set default radio button with Zend_Form_Element_Radio

Setting a default value (‘CHECKED’) in Zend_Form_Element_Radio is done with the function setValue(). This is an example of how to to this in Zend Framework 1.10

$typeOfLap = new Zend_Form_Element_Radio('typeoflap');
               'Practice' => 'Practice',
               'Qualifying' => 'Qualifying'))

As most things in Zend this is also very simple.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.