|
||||
|
I am wondering which would be the best ways to style Zend_Form elements in case of complex forms. Question is both related to selecting proper decorators and css...
Some questions may occur: 1. How to have multiple elements on same line. Not using display groups... So instead of having elements as: label1 field1 label2 field2 ..... To have rather label1 label 2 field1 field2 2. How is possible to display multiple fieldsets on same "line" (arranged horizontally, similar with question 1. ) and without that ugly fieldset border.
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
|
|||
|
Useless answer and this is exactly what Im trying to do. Does anyone have a specific solution to the problem besides "read the manual"? Ive already read through the docs and they are poorly written in this area, and not enough to give a good understanding. Perhaps if I give a specific example someone can help? Here is setting up the form element:
$gender = $form->createElement('radio', 'gender'); $gender->setLabel('Gender') ->addMultiOption('Male', 'male') ->addMultiOption('Female', 'female') ->setAttrib('class','radio') ->setRequired(true); will generate the following code: <dt><label for="gender" class="radio required">Gender</label></dt> <dd> <label style="white-space: nowrap;"><input type="radio" name="gender" value="Male" class="radio">male</label><br /><label style="white-space: nowrap;"><input type="radio" name="gender" value="Female" class="radio">female</label></dd> How can I remove the "<br/>" from the output code? I know there are multiple ways to do this but what is the easiest? |
|
|||
|
How could we pass form name and enctype dynamically? For more clarity below 2 lines I have added in model file.
PHP Code:
<form id="???" enctype="???" action="<?php echo $this->url(array('action'=>'edit')); ?>" method="post" >
__________________
Amit Shah |
|
|||
|
Ok.. I found the solution. getAttrib() function we can use to get name and other attribute of the form which we have set in model.
HTML Code:
<form id="<?php echo $this->form->getAttrib('name'); ?>" enctype="<?php echo $this->form->getAttrib('enctype'); ?>" action="<?php echo $this->url(array('action'=>'edit')); ?>" method="post" >
![]()
__________________
Amit Shah |
![]() |
| Thread Tools | |
| Display Modes | |
|
|