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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:15:13+00:00 2026-05-16T09:15:13+00:00

I got two forms and they share some ids as two input fields are

  • 0

I got two forms and they share some ids as two input fields are called ‘title’.

Zend generates me a nice output like this:

<dl class="zend-form">
  <dt id="title-label">
    <label for="form1-title" class="required">Description</label>
  </dt>
  <dd id="title-element">
    <input name="form1[title]" id="form1-title" value="..." type="text">
  </dd>
</dl>

Now the problem is that the dt and the dd elements are named wrong (should be form1-title-lable as this is a sub form).

I also tried to change the element decorators:

$this->addElements( ... );
$this->setElementDecorators(array(
        'ViewHelper',
        'Errors',
        array(array('data' => 'HtmlTag'),array( 'tag' => 'dd', 'class' => 'element' )),
        array(array('data' => 'Label'),array( 'tag' => 'dt', class=> 'label' ))
  ));

However the outcome wasn’t as expected.

A label was added to my submit button and
the ids of the dt elements were still there.

How do you remove the id attributes?


Edit – Element declaration:

    $titel = new Zend_Form_Element_Text('title');
    $titel->setLabel( "Title" )
          ->addValidator('NotEmpty', true)
          ->addValidator('stringLength',true, array(0, 255 ))
          ->setRequired(true)
          ->addFilter("Alnum", array(true))
          ->addFilter('StringTrim');

    $this->addElement($titel);
  • 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-16T09:15:14+00:00Added an answer on May 16, 2026 at 9:15 am

    It sounds more like the problem is in your subforms not prepending their names to the ID. If you solve that then you won’t need to remove the IDs.

    But, if you want to remove the ID from an element using the DtDdWrapper decorator, you can do something like this.

    class Form_Foo extends Zend_Form_SubForm
    {
        public function init()
        {
    
            $title = new Zend_Form_Element_Text('foo_title');
            $title->setLabel('Title');
            $title->removeDecorator('DtDdWrapper');
            $title->addDecorator(new Decorator_Foo());      
            $this->addElement($title);
        }
    }
    
    class Decorator_Foo extends Zend_Form_Decorator_DtDdWrapper
    {
        public function render($content)
        {
            return '<dt>&nbsp;</dt>' .
                   '<dd>' . $content . '</dd>';
        }
    }
    

    That should give you elements without an ID tag.

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

Sidebar

Ask A Question

Stats

  • Questions 498k
  • Answers 498k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When setting a status code you need to prevent IIS… May 16, 2026 at 12:24 pm
  • Editorial Team
    Editorial Team added an answer Specify you want zero decimal places: String.Format("{0:C0}", item.DonationAmount) May 16, 2026 at 12:24 pm
  • Editorial Team
    Editorial Team added an answer select m.m_ID, u.username, m.message from Messages m, users u where… May 16, 2026 at 12:24 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've got two different forms in my WinForms app (MainForm and Form2 say). They
I've got a Windows Forms application with two ListBox controls on the same form.
I've got two forms. In the first, I have a textbox and a button,
I've got two entities ServiceDownload.java @Entity public class ServiceDownload implements Serializable { private static
I've got a simple table Logins with two columns: username (nvarchar) logged (datetime) It's
hello i got a problem with comparing two char* variables that contains numbers for
I have a solution with two projects. One for project for the production code
I am wanting to write some cross-platform library code. I am creating a library
We are planning to create two sharepoint web applications using SharePoint 2010 Enterprise Edition.
I've got a web app I'm building in ASP.NET that has the following security

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.