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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:24:47+00:00 2026-05-31T05:24:47+00:00

i am using zendframe work for my site, I am using the below mentioned

  • 0

i am using zendframe work for my site, I am using the below mentioned code for a multiselect dropdown box.

$newscat        = new Default_Models_Common();
$row_newscat    = $newscat->fillSelect_new("casestudiesservice","serviceId","serviceName", "serviceStatus='1' ORDER BY serviceName ASC");
$casestudiesServices = new Zend_Form_Element_Multiselect('casestudiesServices[]',array(
                            'class'     => 'text',
                            'value' => $view->row->casestudiesServices,
                            'required'   => true));  

It working fine but i am unable to validate that box.It return empty array

(Array (
[0] => Array
(
) ))..

  • 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-31T05:24:47+00:00Added an answer on May 31, 2026 at 5:24 am

    Please try following method. Maybe it will useful to you.

    Use multi select element like below:

    $multi = new Zend_Form_Element_Multiselect('users');
    $multi->setMultiOptions(array(
        //'option value' => 'option label'
        '21' => 'Milap',
        '22' => 'jay',
        '23' => 'Sandip'
    ));
    $form->addElement($multi);
    

    You can get the values of element like this:

    public function indexAction()
    {
        $form = new MyForm();
    
        $request = $this->getRequest();
        if ($request->isPost()) {
    
            if ($form->isValid($request->getPost())) {
    
                $values = $form->getValues();
                $users = $values['users'];
                var_dump($users);
            }
        }
        $this->view->form = $form;
    }
    

    Here , $users will contain an array of the values that have been selected:

    array(
        0 => '21',
        1 => '23'
    )
    

    Good luck.

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

Sidebar

Related Questions

We are developing a site using ZendFrame work. We need to set a auth
i am wondering using Zend Framework's view helpers, ... code below ... $this->headLink()->prependStylesheet(css/style.css) ->prependStylesheet(css/prettify.css)
We have a site built in Zend Framework and we're using the Zend Soap
I'm relatively new to PHP and have been writing a project using what I
I was looking for HTML/Text content caching for small-mid size site using php. I'll
I am currently developing a multi-language site using Zend Framework. The system will pick
I'm using the Zend framework and the openid selector from http://code.google.com/p/openid-selector/ - however I
I'm building a multi-site Zend Framework application using modules, sort of in the following
I have a site new.mysite.com in Drupal. In the vhost file I have a
I'm using Zend Framework for a miltilingual site. Translating is done with Zend_Translate_Adapter_Gettext. I'm

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.