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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:26:17+00:00 2026-05-23T08:26:17+00:00

Hello I am trying to do a checkbox display like: <input name=choice2 id=choice2 value=1

  • 0

Hello I am trying to do a checkbox display like:

<input name="choice2" id="choice2" value="1" type="checkbox">
<label for="choice2" class="optional">Credit Card</label><br />
Some text

<input name="choice2" id="choice2" value="1" type="checkbox">
<label for="choice2" class="optional">Credit Card</label><br />
Some text

I got very close with the following code:

$lbl_spagym = 'Credit Card<br />
              <p class="description">Some text</p><br />';

$chk_spagym = new Zend_Form_Element_Checkbox('chk_spagym');
$chk_spagym->setLabel($lbl_spagym)
           ->setDecorators(array(
           'ViewHelper',
        'Description',
            'Errors',
        array('Label', array('placement' => 'APPEND', 'escape' => false)),
        array('HtmlTag', array('tag' => 'div'))
    )); 

It renders as:

<div>
<input type="hidden" name="chk_bank" value="0" />
<input type="checkbox" name="chk_bank" id="chk_bank" value="1" checked="checked" />
<label for="chk_bank" class="optional">Credit Card<br />
                     <p class="relocation_descr">Some text</p><br />
</label></div>

But I need the <p></p> to be out of the label tag because ‘some text’ is a description and not a label. I played with decorators for days but can not get this behavior right. Would thanks any comments on that.

  • 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-23T08:26:18+00:00Added an answer on May 23, 2026 at 8:26 am

    I sorted my problem with:

    $checkbox_e->setLabel($e_label)
               ->setDecorators(array('ViewHelper',
                                     'Description',
                                     'Errors',
                                     array('Label',
                                           array('placement'=>'APPEND')),
                                           array('HtmlTag', array('tag' => 'div'))));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I am trying to get text to display like it does in terminal
hello i'm trying to get the first value of a datagrid cell value but
Hello I'm trying to get a multicolumn display (if it can be called so)
I have below code in html <div id=divTest> Hello <input type=text id=txtID/> <input type=text
hello im trying to make something like github treeslider im new to javascript.. but
Hello Im trying to get the value of an element from a JsonObject. i'm
Hello trying to get my website to display correctly having trouble. I am using
hello im trying to implant something like static.domain.com where we can put our image
hello im trying to do something like // 1. for x in glob.glob('/../../nodes/*/views/assets/js/*.js'): //
Hello I am trying to make a terminal type app that is wider than

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.