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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:09:01+00:00 2026-06-02T02:09:01+00:00

i have a scenario where i am adding multiple qualifications, i am saving the

  • 0

i have a scenario where i am adding multiple qualifications, i am saving the values in hidden fields like

 $("<input/>",{type:'hidden',value:deg,name:'degree[]'}).attr("data-deg",deg).appendTo("form");

$("<input/>",{type:'hidden',value:year,name:'year[]'}).attr("data-year",year).appendTo("form");

$("<input/>",{type:'hidden',value:inst,name:'inst[]'}).attr("data-inst",inst).appendTo("form");

if i do var_dump it shows me the following output

["degree"]=> array(2) { [0]=> string(4) "M.Sc" [1]=> string(4) "B.Sc" }

in the controller im getting it like

$Degree = $form->getValue('degree[]'); 

but var_dump($Degree) gives me NULL, how can i get the values plz help

EDIT

here is my form looks like

$degreename = $this->createElement('select', 'degreename')
        ->setRequired(true);
        $degreename->removeDecorator('label');
        $degreename->removeDecorator('htmlTag');
        $degreename->removeDecorator('Errors');
        $ddloptions = $this->db->GetDegrees();
        $degreename->setMultiOptions($ddloptions);
        $degreename->addMultiOptions(array(
                '0'=>'--Select Degree--'
        ));
        $degreename->setValue(0);


        $passingyear = $this->createElement('select', 'passingyear')
        ->setRequired(true);
        $passingyear->removeDecorator('label');
        $passingyear->removeDecorator('htmlTag');
        $passingyear->removeDecorator('Errors');
        $passingyear->addMultiOptions(array(
                '0'=>'--Select Passing Year--',
                '1950'=>'1950',
                '1951'=>'1951',
                '1952'=>'1952',
        )
        );
        $passingyear->setValue('0');


$institute = new Zend_Form_Element_Text('institute');
$institute->setRequired(false)
->addFilter('StripTags')
->addFilter('StringTrim');
$institute->removeDecorator('label');
$institute->removeDecorator('htmlTag');
$institute->removeDecorator('Errors');

though the degreename and the passing year are required they always has the value 0 institute i have set to false the user can add multiple qualifications and upon each user selection i add a hidden field like shown above

  • 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-02T02:09:03+00:00Added an answer on June 2, 2026 at 2:09 am

    How about

    $Degree = $form->getValue('degree'); 
    'degree[]' is not a proper key in php and the POST request
    

    UPDATE1:
    Your Javascript piece for the hidden elements still puzzles me a bit and I wonder if you have a “degree” element in $form. To get a final answer it might be good to know what you use inside your $form.

    If you just need the submitted data (as is) you are just fine getting the information from $_POST. You wouldn’t need Zend_Form for that.

    UPDATE2:
    Now seeing your form code the fog if lifting; you are missing the elements for you hidden elements. When you call isValid($_POST) you have nothing in the form to validate the data. Calling getValue('degree') or actually any of the hidden element will return NULL.

    If you just want the data you will be fine with just $_POST but that is not really secure data handling. Zend_Form elements allow you to add filters and validators for sanitizing the data. For that you have to either create the hidden elements with Zend_Form (use Javascript only to add the values) or have elements in your form you use only for validation. You can use something like if ( !empty($_POST) ) to added them for validation.

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

Sidebar

Related Questions

I have the following markup: <select multiple=multiple id=targetFilesList style=width:200px;height:110px;> </select> <input type=button value=Get id=btnGet
I have a scenario where I have multiple threads adding to a queue and
I have a scenario like this: form = MockRepository.GenerateMock<IAddAddressForm>(); mediator = new AddAddressMediator(form); The
Class person{ int name; }; I have a scenario here in which i'm parsing
I have scenario, I have two update panels on the page (both have update
I have scenario where I have to use the same XSD element for different
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
I have a scenario that my load balancer translates port 80 from outside into
I have a scenario where customers are asking to develop a new project on
I have a scenario where I need to do the following in a transaction:

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.