views:

14

answers:

1

I have created a form:

<?php
class Application_Form_Issue extends Zend_Dojo_Form
{
    public function init()
    {
        $this->setName('issue');
        $this->setMethod('post');

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');

        $date_recvd = new Zend_Dojo_Form_Element_DateTextBox('date_recvd');
        $date_recvd->setLabel('Date Received')
               //->setRequired(true)
               /*->addValidator('NotEmpty'); */; 

        More Form elements ...

To view this form my view script is:

<?php echo $this->form; ?>

This all works just fine, with fully functional dojo form elements (datepicker, timepicker, etc) and successfully saving the data.

However, now, I want to format the form that is generated with css. Such as grouping some elements and floating left or right, making some input text fields wider/narrower, etc. How?

I realize I can modify the view script but it seems like that defeats the purpose of using Zend_Dojo_Form or Zend_Form. Is that a correct assumption?

A: 

Zend_Form works off decorators for each of the elements. IMO it really just provides a quick means of getting a form into the view. However, if you need to perform more advanced css tricks on your elements, I would recommend that you set the CSS for each element in the view.

<?= $this->form->elementOne ?>
MANCHUCK
Yeah, this is what I ended up doing. My thought was that this could all be accomplished in Zend_Form. I am still using Zend_Form, but for validation.
pinardelrio