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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:36:58+00:00 2026-05-31T21:36:58+00:00

This code is copied from another file and it works in that file, I

  • 0

This code is copied from another file and it works in that file, I have checked the variable and form id and i am sure that the name is consistent with the js code. The textbox in genFrom is also validate working, only the checkbox is not working.

<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script>
$(document).ready(function(){
    $("#genForm").validate();
    $("#genForm").validate( {
        rules: {
            agree: {
                required: true
            }
        }
    })
});
</script>
<form id="genForm"  method="post" action="verify.php">
<div class="container">
    <div class="hero-unit">
        <h1>Subscribe for final</h1>
    </div>
    <div class="clearfix">
        <label>Email</label>
        <div class="input">
            <input name="Email" type="text" class='required'>
        </div>
    </div>
    <br>
    <br>
    <div class="clearfix">
    <label>Agreements:</label>
        <div class="input"> 
        <ul class="inputs-list">
            <li>                                      
            I accept the terms and conditions.
            <!-- Check box is here, not working -->
            <input type="checkbox" name="agree" value="1">
            </li>
        </ul>
        </div> 
    </div> 
    <br>
    <input class="btn primary" type="submit" value="Submit">
</form>
  • 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-31T21:36:59+00:00Added an answer on May 31, 2026 at 9:36 pm

    For some reason, you’re calling validate() twice on the same form, you only need one:

    // $("#genForm").validate(); No need for this
    
    $("#genForm").validate( {
      rules: {
          agree: {
              required: true
          }
       }
    });
    

    Demo: http://jsfiddle.net/8MV5F/

    Calling validate() with no params does have some (configurable) default behavior, one of which is attaching the required rule to elements with class='required', which is why the email field was working. You can also use the required attribute for that, and in addition you can use type="email" to validate as an email address without specifying it in your rules.

    Here’s a simple example: http://jsfiddle.net/8MV5F/2/

    <form id="genForm"  method="post" action="verify.php">
        <label>Email:<input name="Email" type="email" required></label>          
        <label>I accept the terms and conditions.
        <input type="checkbox" name="agree" value="1" required></label>
        <input class="btn primary" type="submit" value="Submit">
    </form>
    
    $("#genForm").validate();
    

    This has the advantage of falling back to native browser validation if supported, in case javascript is disabled, or even just broken.

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

Sidebar

Related Questions

I have this sample code for async operations (copied from the interwebs) public class
I copied this code from an example . I've read it 100 times. Array.prototype.map
I'm trying to copy file content from one file to another: srcp = './output/name.jar'
This code is from Prototype.js . I've looked at probably 20 different tutorials, and
This code works (C# 3) double d; if(d == (double)(int)d) ...; Is there a
This code always works, even in different browsers: function fooCheck() { alert(internalFoo()); // We
This code is executed by many way. When it's executed by the form button
I've got 3 files that relate to this problem. file.h, file.C and user.C. file.h
I have the following problem: Text needs to be copied from 1 wordprocessing document
I'm trying to copy some files from one network share to another using File::Copy.

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.