I have a form with captcha element. The text field displays on the right of the image. How can I make it displaying below the image?

$path = Zend_Controller_Front::getInstance()->getBaseUrl();

        $captcha = new Zend_Form_Element_Captcha(
                'label'  => 'Type the characters you see in the image below:',
                'attribs' => array('id' => 'captcha', 'class' => 'required'),
                'required'  => true,
                'captcha' => array(  
                      'captcha' => 'Image',  
                      'wordLen' => 6,  
                      'timeout' => 300,  
                      'font' => APPLICATION_PATH . '/../public/css/LeagueGothic/League_Gothic-webfont.ttf',  
                      'imgDir' => APPLICATION_PATH . '/../public/images/captcha/',  
                      'imgUrl' =>  $path . '/images/captcha',
                      'dotNoiseLevel' => 5,
                      'lineNoiseLevel' => 2,
                      'width' => 220)

I used its id in css file:

#captcha {display: block;}

but the validation error message that needs to appear on the right, now displays below the textfield.

Please advise a solution. Thank you.

Member Avatar

Please advise a solution.

The issue you are having has nothing to do with PHP even though you are using Zend framework. It's more related to design another words it's in CSS you can move the div tags PHP doesn't move div tags.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.