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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:01:48+00:00 2026-06-04T23:01:48+00:00

I have the following part of my form: <input type=checkbox class=hide id=additional-webinar name=additional-webinar-check value=additional-webinar-box>

  • 0

I have the following part of my form:

<input type="checkbox" class="hide" id="additional-webinar" name="additional-webinar-check" value="additional-webinar-box">
<label class="hide" for="additional-webinar">Include Additional Webinar</label>

<div class="hide" id="additional-webinar-box" style="display:none;">
        <label class="title">Select Additional Webinar</label>
        <select name="additionalWebinarSelection">
            <option value="0" selected="">Please Select</option>
            <option value="173">Del All test(Elite Options Mastery)</option>
            <option value="171">Glob Test(Elite Futures Mastery)</option><option value="169">Test 2(Elite Futures Mastery)</option>
            <option value="167">Test(Elite Futures Mastery)</option><option value="164">Test(Elite Futures Mastery)</option>
            <option value="162">New Min TEst(Elite Futures Mastery)</option><option value="160">Min Height Test(Elite Options Mastery)</option>
            <option value="158">Title Yo(Elite Options Mastery)</option><option value="156">Title(Options Made Easy)</option>
            <option value="96">TT Test(Daily Wealth Report)</option>
        </select>
</div>

The div get’s shown if the checkbox is checked, otherwise it is hidden.

I have the following validator code on it

jQuery('#validate').click(function(){

    jQuery("form").validate({

        rules: {
            additionalWebinar: {
                required: {
                    depends: function() {
                        return jQuery('input[name=additional-webinar-check]').is(":checked")
                    }
                }
            }
        }
    })
});

However this always evaluates as true as the select element will always have a selected option. How do I get it to return false on the default. I have tried the following:

depends: function() {
    if(jQuery('input[name=additional-webinar-check]').is(":checked")) {
        var input = jQuery('select[name=additionalWebinarSelection]').val();

        if (input == 0) {
            alert(input);
            return false;
        } else {
            return true;
        }
    }
}

But to no avail.

There are no console errors that are triggered by calling the validate function (I am purposely forcing a call to it)

This is all being done on a WordPress blog using the Official jQuery Validator jQuery Plugin

So how is this done and/or what have I done wrong?

  • 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-04T23:01:50+00:00Added an answer on June 4, 2026 at 11:01 pm

    Josha,

    AFAIK, Validator api require that the rules should have element ids. You need to add “additionalWebinar” as id of the select element.

    jQuery('#validate').click(function(){
    jQuery("form").validate({
    
        rules: {
            additionalWebinar: { // this has to be an Id of an Element
                required: {
                    depends: function() {
                        return jQuery('input[name=additional-webinar-check]').is(":checked")
                    }
                }
            }
        }
    })
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code: <input type=hidden name=qz_id value=<?=$quizid; ?> /> <input type=hidden name=s_id value=<?=$s_id;
I have following UI part on JSF - it's simple search form with input
I have the following form as part of a registration process: <form class="form1" id="register_form1"
$i=0; while (db_data) { $i++; echo '<input type=checkbox name=v['.$i.'] value='.$url.''; if ($v[$i]) { echo
I have the following form: form <?php echo '<td><form action=episodesdelete.php method=POST>'; echo '<input type=hidden
I have an HTML document with the following form: <form> <input type=text id=price> <input
I have the following class (part of it): class SearchViewModel : BaseViewModel<SearchResultItem> { private
I have the following ugly if statement that is part of a class that
I have the following form in a partial view @model PartDetail @using (Ajax.BeginForm(Create, Part,
I have the following structure in a form: <div class='full'> <div class='half'> <label>Book</label> <select

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.