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

  • SEARCH
  • Home
  • 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 8177295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:28:25+00:00 2026-06-06T23:28:25+00:00

I have a zend form and a I need the final Output HTML of

  • 0

I have a zend form and a I need the final Output HTML of the Radio Group to be like this :

<div>
     <span class='radio_title'>Gender</span> <!-- The issue is in this line -->
     <span class='felement'>
          <label ....> <input type="radio" ...... value="male" /></label>
          <label ....> <input type="radio" ...... value="female" /></label>
     </span>
</div>

(i.e.) Replace the default dt and dd with customized div or span tags

I created a decorator as follows:

$decorator = array(
'ViewHelper',
'Errors',
   array(array('data' => 'HtmlTag'), array('tag' => 'span', 'class'=> 'felement')),
   // the next line is never applied
   array('Label', array('tag' => 'span', 'class'=> 'fradio' , 'placement'=>'prepend') ),
   array(array('row' => 'HtmlTag'), array('tag' => "div"))
);

$gender = new Zend_Form_Element_Radio("gender",
        array(
              "label"=>"Gender",
              'multiOptions'=>array(
              'male'=>'Male',
              'female'=>'Female'
            ),
            "decorators"=>$decorator
));

and I got this output instead:

<dt id="gender-label">
      <label class="optional">Gender</label>
</dt>
<!-- i don't know why the Main Label of the radio group didn't 
have the Label decorator applied to it -->
<div>    
   <span class="felement">
     <label for="gender-male"><input type="radio" disablefor="1" checked="checked" value="male" id="gender-male" name="gender">Male</label>
      <label for="gender-female"><input type="radio" disablefor="1" value="female" id="gender-female" name="gender">Female</label>    
   </span> 
</div>
  • 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-06-06T23:28:26+00:00Added an answer on June 6, 2026 at 11:28 pm

    I Applied this Decorator:

    array(
                'ViewHelper',
                'Errors',               
                    array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class'=> 'fradioelement')),
                    array('Label', array('tag' => 'span', 'class'=> 'fradiotitle') ),
                    array('description', array('tag' => 'span')),
                    array(array('row' => 'HtmlTag'), array('tag' => "div","class"=>"radioelement"))
    
                );
    

    And it gave me this output:

    <div class="radioelement">
        <span id="gender-label"><label class="fradiotitle optional" for="gender">Gender</label></span>
        <div class="fradioelement">
                <label for="gender-male"><input type="radio" checked="checked" value="male" id="gender-male" name="gender">Male</label>
                <label for="gender-female"><input type="radio" value="female" id="gender-female" name="gender">Female</label>
        </div>
     </div>
    

    Which is almost what I needed.

    ** I had to add :

    'disableLoadDefaultDecorators' => true
    

    in the options of the element

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

Sidebar

Related Questions

Hello i have a Zend Form with 2(two) Zend_Validate_Db_RecordExists toghether like this : $ditta_esiste
I have the Zend Form with some elements. And I need to placing some
I have a zend form, and I need to provide a dynamic link on
I would like to have a form that gets output into a table. The
I have a Zend form where there are lot of textboxes. I need to
I have tried all the combinations I can think off but this form: class
I have a Zend_Form with file element like this: ->addElement('file', 'image', array( 'required' =>
I have a Form element: $Form=new Zend_Form; $Form->setAction($this->view->url(array('controller'=>'auth','action'=>'create'),null,true)) ->setMethod('post') ->setAttrib('id','auth-form') ->removeAttrib('enctype'); As can be
About to create a form using Zend Form, all the form elements should have
I am working on zend. I have a form with some checkboxes. 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.