On Mon, Feb 2, 2009 at 2:54 PM, PHPScriptor <[email protected]> wrote:
>
> Not that I know. But if you post your code, we can have a closer look...
>

my Form code:
============
<?php

class Form_PostInfo extends Zend_Form
{

       public function init()
   {

       //create title element
       $title = New Zend_Form_Element_Text('title');
       $title->setLabel('*Title:');
       $title->setAttrib('size', '75');
       $title->setAttrib('maxlength', '75');
       $title->setRequired('true');
       $title->addFilter('StringTrim');
       $title->addValidator('NotEmpty');
       $title->addErrorMessage('Title should not be empty.');
       $title->addValidators(array
           (array('validator' => 'StringLength', 'options' => array(0, 75)
       )));


       // add locations in selectbox element
       // data will be filled up by controller from database
       $location = New Zend_Form_Element_Select('locname');
       $location->setLabel('*Location:');
       $location->setRequired(true);


       // add captcha to verify human

       //first create an captcha image
       $captchaimg = New Zend_Captcha_Image('captchaimg');
       $captchaimg->setFont("../application/captcha/fonts/tahoma.ttf");
       $captchaimg->setImgDir($_SERVER['DOCUMENT_ROOT'] . '/images/captcha/');
       $captchaimg->setImgUrl("/images/captcha/");
       $captchaimg->setWordlen('6');
       $captchaimg->setMessage("Entered value didn't match with the
value shown",
                               'badCaptcha');


       //create user input for captcha and include the captchaimg
       $mycaptcha = New Zend_Form_Element_Captcha('adcaptcha', array(
           'captcha' => $captchaimg));
       $mycaptcha->setLabel('Please enter the letters displayed below:');
       $mycaptcha->setRequired(true);


       // add the submit button
       $submit = New Zend_Form_Element_Submit('submit');
       $submit->setLabel('Submit');


       //add the created form elements in this form
       $this->addElements(array($title, $location, $mycaptcha, $submit));


       // set the method for the display form to POST
       $this->setMethod('post');
       $this->setName('post_info');
       $this->setAttrib('id', 'infoform');
   }


}
=====================

This renders the Form in browser as follows:
============
Title:
Location:
 [select box]
Captcha Image plus entry box
Submit button
==============

If I try to change the order of the elements (supposing Location first
and Title second), it still shows the same form as previous one.

Any suggestion?

=======================
Registered Linux User #460714
Currently Using Fedora 8, 10
=======================

Reply via email to