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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:49:43+00:00 2026-05-20T19:49:43+00:00

As an addition to ZF: how to check GET request? . I have two

  • 0

As an addition to ZF: how to check GET request?.

I have two input fields and one checkbox. The form is standart.

public function init()
{
    $this->setMethod('GET');

    $new = new Zend_Form_Element_Checkbox('new');
    $new->setLabel('New')
        ->setOrder(3);

    $app = new Zend_Form_Element_Select('app');
    $app->setLabel('System')
          ->setOrder(2)
          ->setRequired()
          ->addMultiOptions(array('0' => ' ----------- ') + $applications);

    $cat = new Zend_Form_Element_Select('cat');
    $cat->setLabel('Theme')
          ->setOrder(1)
          ->setRequired()
          ->addMultiOptions(array('0' => ' ----------- ') + $categories);

    $submit = new Zend_Form_Element_Submit('submit');
    $submit->setLabel('Search')
          ->setOrder(4);

    $this->addElements(array(
        $cat, $app, $new, $submit
    ));
}

1) I do the submit where new is 0: http://site.com/?cat=0&app=0&new=0

2) I do the submit where new is 1: http://site.com/?cat=0&app=0&new=0&new=1

Why the new field has duplication then? I would be good if new=0 is absent if new=1

  • 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-20T19:49:44+00:00Added an answer on May 20, 2026 at 7:49 pm

    I think it is because Zend_From creates a hidden input field next to your checkbox. It does it because when checkbox is not checked, by definition, no value associated with the checkbox is being sent to the server. So Zend_Form creates the hidden field to have something sent in case a checkbox is unchecked. However, the drawback is that when the checkbox is checked, two values are sent, i.e. a hidden one and the actual value of checkbox.

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

Sidebar

Related Questions

If I have this classes: public interface IBinaryCalculator{ double addition(double numb1, double numb2); }
I have a checkbox on one of my forms. And unfortunately, I cant't seem
I have table with a check-all checkbox in the header which checks all the
I have a Scouts model that requires two actions in addition to the standard
In addition to the datastore for your specific site, can you also share one
I am allowing a user to enter dimensions of a box through form fields.
I'm faced with a situation where I have two tables: A and B. B
i am trying to implement my own gesture recognizer in addition to the one
There's an entity A . In addition, there's an entity B which has two
In addition to this question: iPhone network performance , I would like to know

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.