|
|||
|
Hello everybody
Pls forgive me if this question has already been answered. I searched the forum, but could not find what exactly I am looking for. I am very new to Zend Framework. I am developing a complicated registration screen which has almost all kind of html controls in it (e.g text box, text area, drop downs , radio buttons,etc etc.) I have created a SignupForm class by subclassing Zend_Form. After that I instantiated various ZF's library classes which are responsible for creating such controls e.g Zend_Form_Element_Text, Zend_Form_Element_Submit etc. Sample code is as follows : PHP Code:
So when this text box is rendered on the browser, it is not exactly how I want it to be from the UI perspective. Screenshot of such a text box (when it has been rendered on the browser) is attached: Now what I want is the text Profile ID (text in the image) to be aligned with the text box. A little search with generated html (after the control has been rendered shows that Zend Frramework has used <dt> and <dd>. code snippet of the generated html is show below : HTML Code:
.. .. .. <tr> <td>Profile ID</td> <td><dt><label for="profileId" class="required">Profile ID</label></dt> </tr> <dd> .. .. .. Question: How can I get rid of these tags or in otherwords how can I format my UI design in such a way that the text (i.e html control label is aligned with text box or any other control for that matter). I guess decorators are the answer for this. Any sample tutorial /url into this would be great. Anybody who has already resolved such kind of issues can share their exp. Apart from this, in my registration form, I need to capture User's date of birth. Question : Does ZF provides any Date of Birth control OOB (out-of-the-box)? If not, then is dropdowns (placing 3 dropdowns side by side, for day, month and year) the only way to create date of birth field? Sorry for the long post. Any help would highly be appreciated Thanks Jameel :-) Last edited by jameel.j2ee : 10-12-2008 at 12:50 AM. |
|
|||
|
Can we write custom decoder which prints html as follows (when a text box is rendered on the browser):
<input type="text" name="firstname" id="firstname" value=""> I just DO NOT want this piece of code to be embedded into any tag If above is possible, then I can create the HTML page (.phtml rather as per my design) and the I can use ViewScript as follows : Code:
$this->addElements(array($profileId, $email, $confirmEmail, $password, $confirmpassword, $submit));
//Set a html decorator form//
$this->setDecorators ( array (array ('ViewScript', array ('viewScript' => 'signup/index.phtml' ) ) ) );
HTML Code:
<form action="<?= $this->signupForm ->getAction() ?>" method="<?= $this->signupForm->getMethod() ?>" id="<?= $this->signupForm->getName() ?>"> <table border="1" width="100%"> <tr> <td>Profile ID</td> <td><?= $this->signupForm->profileId ?> </td> </tr> <tr> <td>Email</td> <td><?= $this->signupForm->email ?></td> </tr> <tr> <td>Confirm Email</td> <td><?= $this->signupForm->confirmEmail ?></td> </tr> <tr> <td>Password</td> <td><?= $this->signupForm->password ?></td> </tr> <tr> <td>Confirm Password</td> <td><?= $this->signupForm->confirmpassword ?></td> </tr> <tr> <td colspan="2"><?= $this->signupForm->submit ?></td> </tr> </table> </form> So by above design, we can get the HTML page design the way we ideally want it to be without unnecessary markup. Does this sound logical? Anybody? Thanks Jameel |
|
|||
|
Almost got it but there is a problem with the submit button :
My Form : PHP Code:
PHP Code:
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|