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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:30:32+00:00 2026-06-13T02:30:32+00:00

I have a multicheckbox element like that: $element = new Zend_Form_Element_MultiCheckbox(‘infos’, array(‘disableLoadDefaultDecorators’ => true));

  • 0

I have a multicheckbox element like that:

$element = new Zend_Form_Element_MultiCheckbox('infos', array('disableLoadDefaultDecorators' => true));
$element->addDecorator('ViewHelper')
        ->setRequired(true)
        ->addMultiOption('value1', 'BLABLABLA')
        ->addMultiOption('value2', 'BLABLABLA2')
        ->addValidator('NotEmpty', true);
$element->getValidator('NotEmpty')->setMessage('Pelo menos uma informação é necessária');
$this->addElement($element);

When i render a multicheckbox element, it appears like that:

<p>     
     <label for="infos-value1">
            <input type="checkbox" name="infos[]" id="infos-value1" value="value1">BLABLABLA
     </label><br>
     <label for="infos-value2">
             <input type="checkbox" name="infos[]" id="infos-value2" value="value2">BLABLABLA2
     </label><br>
 </p>

And i want to add an attribute for only, let’s say, the first input, so the first input would be something like:

<input type="checkbox" name="infos[]" id="infos-value1" value="value1" disabled>BLABLABLA
 </label><br>

How do i add the attribute “disabled” to just one of my two inputs?

  • 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-13T02:30:33+00:00Added an answer on June 13, 2026 at 2:30 am

    Simply pass the indexes for the options to disable like so:

    $element->setOptions(array('disable' => array('value1', 'value2')));

    Not sure this is very well documented anyplace. I am hoping to see some improvements with multi-selects in ZF 2.0. Currently they do have their limitations. Specifically setting class or style attributes on individual options. I have had to extend/add alternate element classes and view helpers to get around some of those issues in the past. Easy enough to do if you must.

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

Sidebar

Related Questions

I have a Zend_Form with multiple Multicheckbox element, the thing that I want is
I am quite bad at php. I have a Multicheckbox that outputs an array
how do i have to nest multicheckboxes so that they are named like this
i have this form: $this->addElement ( 'multiCheckbox', 'servers2', array ( 'checkedValue' => '0', 'multiOptions'
hi i'm using zend form multicheckbox. I have an $array in which I have
I have a Zend_Form_Element_Multicheckbox and I want to put some of its elements in
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
i have a problem with this Zend form element, how can i read the
Have such user_session model: class UserSession < Authlogic::Session::Base logout_on_timeout true # default if false
Have a simple form that has a PictureBox in one location. I want to

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.