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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:19:57+00:00 2026-05-27T17:19:57+00:00

Using jQuery version 1.4.2 and Validation plugin version 1.8.1 I have a textbox that

  • 0

Using jQuery version 1.4.2 and Validation plugin version 1.8.1

I have a textbox that is required only if a checkbox is checked.
If I declare the rule in the validation method it works flawless:

$("#tipoEntradasForm").validate({
    rules: {
        cantidad_aforo: { required: "#aforo_limitado:checked" }
    }
})

but for the sake of simplicity, I need to declare it in an attribute on the input tag.

I tried several variations, all of them something like

<input
    name="cantidad_aforo" id="cantidad_aforo" type="text" 
    class="anchofecha"
    required="#aforo_limitado:checked"
    min="1"
    value="" 
/>

but with no success.

Can anybody tell me if I am doing something wrong and what should I do instead? Any advice would be much appreciated.

Thanks !

  • 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-27T17:19:57+00:00Added an answer on May 27, 2026 at 5:19 pm

    Input’s attribute ‘required’ is not the same thing as the jquery validation’s method. So you can’t do it like this.
    So the original code is the simpliest way to get what you want.

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

Sidebar

Related Questions

I'm using: jQuery validation plug-in 1.6 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ with the latest version of jQuery.
We are using jquery validation plugin in our project. Recently we have upgraded our
Using the jQuery validation plugin(Ver 1.7) from here ...breaks when upgrading to version 1.4.3
If i using the official jquery lib the validator (bassistance.de/query-plugins/jquery-plugin-validation) have an annoying bug,
I have a validation script that absolutely positions a series of <span> s using
I've been using the JQuery Autocomplete plugin with JQuery version 1.3.2, and it has
I am using the jquery form validation plugin to validate a long form. If
I have a form using jQuery 1.7 and jQuery validation 1.9 (latest each at
I'm using jQuery's validation plugin and looking to validate many dynamically added text fields
I'm using this jQuery validation plugin and getting the famous: $(#Form).validate is not a

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.