Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4104748
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:09:27+00:00 2026-05-20T21:09:27+00:00

I have form and I want to add several elements in one div. But

  • 0

I have form and I want to add several elements in one div. But I thing I have made a mistake. Can some one help me. Here is my code:

class Application_Form_Register extends Zend_Form
{
    public function init()
    {
        $this->addElement('text', 'a', array(
            'label' => 'aa',
            'required'  => true,
        ));
        $this->addElement('text', 'b', array(
            'label' => 'bb',
            'required'  => true,
        ));
        $this->addElement('text', 'c', array(
            'label' => 'cc',
            'required'  => true,
        ));
        $this->addElement('text', 'd', array(
            'label' => 'dd',
            'required'  => true,
        ));
        $this->addElement('text', 'e', array(
            'label' => 'ee',
            'required'  => true,
        ));

        $this->getElement('c')->addDecorator('HtmlTag', array('tag' => 'div', 'openOnly' => 'true',  'placement' => Zend_Form_Decorator_Abstract::PREPEND,));
        $this->getElement('d')->addDecorator('HtmlTag', array('tag' => 'div', 'closeOnly' => 'true',));
    }
}

Then i render form i get html like:

<form enctype="application/x-www-form-urlencoded" action="" method="post">
<dl class="zend_form">
<dt id="a-label"><label for="a" class="required">aa</label></dt>

<dd id="a-element">
<input type="text" name="a" id="a" value="" /></dd>
<dt id="b-label"><label for="b" class="required">bb</label></dt>
<dd id="b-element">
<input type="text" name="b" id="b" value="" /></dd>
<dt id="c-label"><label for="c" class="required">cc</label></dt>

<div>

<input type="text" name="c" id="c" value="" />
<dt id="d-label"><label for="d" class="required">dd</label></dt>

<input type="text" name="d" id="d" value="" />

</div>

<dt id="e-label"><label for="e" class="required">ee</label></dt>

I set decoratos to set DIV to enclose C and D element, but i get enclosed D and C input but not C label

Ho to get DIV up before line:

<dt id="c-label"><label for="c" class="required">cc</label></dt>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:09:28+00:00Added an answer on May 20, 2026 at 9:09 pm

    Display groups are ment to group form elements. I’d stick with them. Beware of divitis.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a Form that can Add or Delete TextFields. I was
I have a form and I want to add a select location option. How
I have a combobox in a form and a button. I want to add
I have a textbox in a form that I created. I want to add
how can I jump to another action in controller? I have form and several
I have a page which contains several forms. I want to add a single
I want to have a form that contains a table of fields and some
I have a form with several input fields for a User to add their
I have a user control on a form that can spawn several non-modal child
I have a form which contains several standard controls (textbox's, buttons, etc). I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.