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 692951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:42:14+00:00 2026-05-14T02:42:14+00:00

How can I display more than 1 display group WITHIN a div? I simply

  • 0

How can I display more than 1 display group WITHIN a div?

I simply need to show a visual separation – but within the same div.

Is there a way to show more than 1 display group within a div?

for example: to achieve the following in zend forms:

  <div style="width: 100%;">     

       <div style="width: 50%; float: left; padding-left: 20px; padding-bottom: 25px;">
       <fieldset id="fieldset-homeAddressSettings" tag="fieldset" style="">
         <legend> Home address </legend>
        <!-- multiple elements follow -->
        </fieldset>
       </div>
      <div style="width: 50%; float: left; padding-left: 20px; padding-bottom: 25px;">
     <fieldset id="fieldset-officeAddressSettings" tag="fieldset" style="">
         <legend> Office address </legend>
        <!-- multiple elements follow -->
     </fieldset>  
       </div>
  </div>

How can I achieve this in Zend forms?

I have searched and searched and i have not found anything useful so far.

  • 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-14T02:42:14+00:00Added an answer on May 14, 2026 at 2:42 am

    The ‘openOnly’ and ‘closeOnly’ boolean options for the ‘HtmlTag’ decorator do exactly what you need to do. What openOnly means, as you can figure out, is that it only generates an opening tag (i.e. ) without the closing tag, and vice-versa for the closeOnly attribute (i.e.

    Zend_Form PHP code:

    $form = new Zend_Form();
    
    // Form stuff here
    
    $form->addDisplayGroup(
        array(
            'homeAddressLine1',
            'homeAddressLine2',
            'homeCity',
            // etc
        ),
        'homeAddress',
        array(
            'legend' => 'Home Address'
            'disableDefaultDecorators' => true,
            'decorators' => array(
                'FormElements',
                'FieldSet',
                array('HtmlTag', array('tag' => 'div', 'class' => 'addresses', 'openOnly' => true))
            )
        )
    );
    
    $form->addDisplayGroup(
        array(
            'workAddressLine1',
            'workAddressLine2',
            'workCity',
            // etc
        ),
        'workAddress',
        array(
            'legend' => 'Work Address'
            'disableDefaultDecorators' => true,
            'decorators' => array(
                'FormElements',
                'FieldSet',
                array('HtmlTag', array('tag' => 'div', 'closeOnly' => true))
            )
        )
    );
    

    Generated HTML:

    <form <!-- Your Zend_Form attributes here -->>
        <div class="addresses">
            <fieldset id="fieldset-homeAddress">
                <legend>Home Address</legend>
                <!-- Your Home Address elements/decorators here -->
            </fieldset>
            <fieldset id="fieldset-workAddress">
                <legend>Work Address</legend>
                <!-- Your Work Address elements/decorators here -->
            </fieldset>
        </div>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using System.Drawing.Color, is there anything in Visual Studio that can display the color
If you have a statically allocated array, the Visual Studio debugger can easily display
Is there a way to use Int32.ToString(<some string format specifier>) with using more than
If I have more than one asp.net server validator on the same control, (Suppose
My application contains a line graph which can display 20 or more datasets at
Is there a way for more than one object to listen to void delegate
Can anyone tell me how I can display a status message like 12 seconds
With LINQ to SQL in a ASP.NET MVC website I can display objects (records)
I have a small app which references the Microsoft.SqlServer.Smo assembly (so I can display
How can I display a sort arrow in the header of the sorted column

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.