Here is a sample of my own code. Be careful, I'm a newbie on ZF so maybe
it's not the best example you could have.

                // Lastname
                $lastname = new Zend_Form_Element_Text('lastname');
                $lastname->setAttrib('class', 'field');
                if (isset($this->view->registerSession->user['lastname']))
$lastname->setValue($this->view->registerSession->user['lastname']);
                $lastname->addValidator(new Zend_Validate_Alpha('true'));
                $lastname->addFilter(new Zend_Filter_StringToUpper());
                $lastname->setRequired(true);

                // Firstname
                $firstname = new Zend_Form_Element_Text('firstname');
                $firstname->setAttrib('class', 'field');
                if (isset($this->view->registerSession->user['firstname']))
$firstname->setValue($this->view->registerSession->user['firstname']);
                $firstname->addValidator(new Zend_Validate_Alpha('true'));
                $firstname->addFilter(new Zend_Filter_StringToLower());
                $firstname->setRequired(true);

                // Forms
                $form->addElement($lastname);
                $form->addElement($firstname);
                $form->addDisplayGroup(array('lastname', 'firstname'),
                                       'Informations Personnelles',
                                       array('legend' => 'Informations
personnelles'));


On Thu, Sep 25, 2008 at 7:44 PM, devxtech <[EMAIL PROTECTED]> wrote:

>
> I'm trying to set up a contact form with the proper elements so I can apply
> a
> CSS style sheet to it. Could someone provide me an example of how to
> properly use the setLegend and addDisplayGroup methods for interacting with
> Zend_Form_DisplayGroup.
> --
> View this message in context:
> http://www.nabble.com/Zend_Form-How-do-I-use-setLegend---addDisplayGroup--tp19674858p19674858.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
Thomas VEQUAUD   http://thomas.vequaud.free.fr/
Ingénieur Systèmes pour le compte d' ITS GROUP
Bénévole et secouriste à la Croix-Rouge Française

Reply via email to