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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:34:12+00:00 2026-05-31T17:34:12+00:00

Having a Zend_Form with a Zend_Form_Element_Select on it, i can set ONE option selected

  • 0

Having a Zend_Form with a Zend_Form_Element_Select on it, i can set ONE option selected with setDefault. But how can i select multiple items on that element, like

$this->setDefaults(array('groups' => 5, 'groups', 7));

But this will only select the option with value 7, option with value 5 is still NOT selected 🙁
($this is zend_form)

  • 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-31T17:34:13+00:00Added an answer on May 31, 2026 at 5:34 pm

    a Zend_Form_Element_Select element can only have one value. If you want a multiselect element, you can use Zend_Form_Element_Multiselect. To set the defaults, you can use either:

    $this->setDefaults(array('elementName' => array(5, 7)));
    

    or

    $this->setDefault('elementName', array(5, 7));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble over ridding the default set of decorators with Zend_Form. I
I'm having a strange problem with Zend_Db_Adapter_Mysqli . I need to query multiple items
I'm working on a form upload element that can be used in the Zend
I am having problems getting validation to work for a form built using Zend_Form.
Having a heckuva time with this one, though I feel I'm missing something obvious.
I'm having difficulty configuring Zend_Form. I have a Zend_Form sub-class. The form has some
I'm building a Zend_Form.Having: $file=new Zend_Form_Element_File('file'); $file->setDescription('upload a picture:') ->setDestination(myPath); $file->class=media[]; $file->setDecorators(array( 'File', array('Description',array('placement'=>'PREPEND','tag'=>'')),
How would one go about having a multi step type form with zend. This
I'm having some problems translating this query to use ZF's Zend_Db_Select : SELECT b.id,
I'm having a problem displaying breadcrumbs with Zend_Navigation. I have a single controller that

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.