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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:22:58+00:00 2026-05-14T03:22:58+00:00

By default, Zend_Form creates a hidden input field for each checkbox input in the

  • 0

By default, Zend_Form creates a hidden input field for each checkbox input in the form. These inputs share the same name.

<input type="hidden" name="zend-cb" value="">
<input type="checkbox" name="zend-cb" id="zend-cb" value="1">

I want to require the checkbox, so I set up the following rule in my jquery plugin validator (http://bassistance.de/jquery-plugins/):

'zend-cb': {
  required: true
}

Unfortunately, the Jquery Validation plugin always validates the hidden field instead of the checkbox. Is there a way I can have it validate the checkbox instead? I realize I could change my Zend Decorator to omit the hidden field, but I’d like to find a pure javascript solution.

Solution

Two steps are needed to get around this problem.

1) Add ignore: “input[type=hidden]” as an option to the validate method.

$('#myForm').validate( {
   ignore: "input[type=hidden]",
   rules: { ... }
}

2) Open jquery.validate.js and update the findByName method to use the ignore filter. Bug report filed by adamnfish on the jquery plugin site.

findByName does not honour ignore settings

findByName: function( name ) {
        // select by name and filter by form for performance over form.find("[name=...]")
        var form = this.currentForm;
        return $(document.getElementsByName(name)).not(this.settings.ignore).map(function(index, element) {
            return element.form == form && element.name == name && element  || null;
        });
    },
  • 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-14T03:22:58+00:00Added an answer on May 14, 2026 at 3:22 am

    You can use the ignore option of the validation plugin.

    $("#yorform").validate({
        ...
        ignore: "input[type=hidden]"
    })
    

    This should for example stop the plugin from validating any hidden inputs

    Check the documentation for more info

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

Sidebar

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.