Organizational Research By

Surprising Reserch Topic

zend form decorators css and displaygroups


zend form decorators css and displaygroups  using -'zend-framework,zend-form'

I'm trying with DisplayGroups in my form. I'm sure it is a css understanding problem.
This is how my form looks like:



Now I would love to make it nicer:
How can I move the legend of the Displaygroup onto the border?
How can I make the distance smaller between my labels an the fields?

Here is my formclass:

$this->setName('Schwestern');
    $this->setMethod('post');

    $vorname=$this->addElement('TextBox','vorname',array(
            'label'     => 'Vorname:',          
    ));

    $nachname=$this->addElement('TextBox','nachname',array(
            'label'     => 'Nachname:',

    ));

    $strasse=$this->addElement('TextBox','strasse',array(
            'label'     => 'Strasse:',          
    ));

    $plz=$this->addElement('TextBox','plz',array(
            'label'     => 'PLZ:',          
    ));

    $ort=$this->addElement('TextBox','ort',array(
            'label'     => 'Ort:',          
    ));

    $telefon=$this->addElement('TextBox','telefon',array(
            'label'     => 'Telefon:',          
    ));

    $handy=$this->addElement('TextBox','handy',array(
            'label'     => 'Handy:',            
    ));

    $email=$this->addElement('TextBox','email',array(
            'label'     => 'Email:',            
    ));

    $geburtsdatum = $this->addElement('DateTextBox','geburtsdatum',array(
        'label'     => 'Geburtsdatum:',
        'datePattern' => 'dd-MM-yyyy'
    ));



    $this->addDisplayGroup(array(

            'vorname',
            'nachname',
            'strasse',
            'plz',
            'ort',
            'geburtsdatum'

    ),'contact',array('legend' => 'Name und Anschrift'));

    $contact = $this->getDisplayGroup('contact');
    $contact->setDecorators(array(

            'FormElements',
            'Fieldset',
            array('HtmlTag',array('tag'=>'div','style'=>'width:200px;;float:left;border-style:solid; margin:5px;padding:5px;border-width:1px;border-color: grey;'))
    ));

    $this->addDisplayGroup(array('telefon','handy','email'), 'kontaktdaten',array('legend'=>'Kontaktdaten'));
    $this->getDisplayGroup('kontaktdaten')->setDecorators(array(

                'FormElements',
                'Fieldset',
                array('HtmlTag',array('tag'=>'div','style'=>'width:200px;;float:left;border-style:solid; margin:5px;padding:5px;border-width:1px;border-color: grey;'))
    ));


$this->setDecorators(array(
    'FormElements',                       
    array(array('data'=>'HtmlTag'),
    array('tag'=>'table','cellspacing'=>'6')),
    'DijitForm'
));

    
asked Oct 19, 2015 by sandeep bhadauria
0 votes
9 views



Related Hot Questions



Government Jobs Opening


...