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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:15:49+00:00 2026-06-06T06:15:49+00:00

i have been trying to validate This Form: <table> <form action=test.html method=post id=contactform name=contactform>

  • 0

i have been trying to validate This Form:

<table>
<form action="test.html" method="post" id="contactform" name="contactform">
<tr>
    <td>
    <label for="fname">First Name :</label>
    </td>

    <td>
    <input name="fname" id="fname" type="text" /> 
    </td>
</tr>
<tr>
    <td>
    <label for="lname">Last Name :</label>
    </td>

    <td>
     <input name="lname" id="lname" type="text" /> 
    </td>
</tr>

<tr>
    <td>
     <label for="gender">Gender :</label>
    </td>

    <td>
     <input name="gender" id="genderm" type="radio" /> Male  <input name="gender" id="genderf" type="radio" /> Female
    </td>

</tr>

<tr>
    <td>
      <label for="email">Email :</label> 
    </td>

    <td>
     <input name="email" id="email" type="text" /> 
    </td>
</tr>

<tr>
    <td>
    <label for="address">Address :</label>
    </td>

    <td>
    <input name="addr" id="addr" type="text" /> 
    </td>
</tr>

<tr>
    <td>
    <label for="mob">Mobile Phone :</label>
    </td>

    <td>
    <input name="mob" id="mob" type="text" /> 
    </td>
</tr>

<tr>
    <td>
     <label for="dob">Date Of Birth (mm/dd/YYYY):</label>
    </td>

    <td>
    <input name="dob" id="dob" type="text" />     
    </td>
</tr>

<tr>
    <td>
     <label for="agreeT">By Checking This you agree to our Terms  :</label>
    </td>

    <td>
     <input name="agreeT" id="agreeT" type="checkbox" />

    </td>
</tr>

   <tr>
    <td>
     <input type="submit" value="Sumbit" />
    </td>

</tr> 

But i am unable to Validate it using Jquery Validation Plugin i am Adding these Scripts Code in my File:

<script src="jquery.js"></script>
<script src="jquery.validate.js"></script>

<script language="javascript">

$(document).ready(function(e) {


    var validator = $("#contactform").validate({ 

    rules : {
        fname: "required",
        lname: "required",
        email: {
            email: true,
            required: true
        },
        gender:" required",
        addr: "required",
        dob: {
            required: true,
            date: true
        },
        agreeT: "required"
    }

    }
    );



});


</script>

Can anyone tell me why i am going to the test.html without validating the form….?? Is there any Syntax error??

  • 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-06T06:15:50+00:00Added an answer on June 6, 2026 at 6:15 am

    Working code.. checked::—

    Just try:–

    Steps to follow:-

    1. You have to view source and see if any script is not coming fine.
    2. try to debug your errors or warning.
    3. checked you are passing correct id .
    4. try to check your plugins
    5. Try show your error messages.

    Your Html code:-

    <form action="test.html" method="post" id="contactform" name="contactform">
        <table>
    
    <tr>
        <td>
        <label for="fname">First Name :</label>
        </td>
    
        <td>
        <input name="fname" id="fname" type="text" /> 
        </td>
    </tr>
    <tr>
        <td>
        <label for="lname">Last Name :</label>
        </td>
    
        <td>
         <input name="lname" id="lname" type="text" /> 
        </td>
    </tr>
    
    <tr>
        <td>
         <label for="gender">Gender :</label>
        </td>
    
        <td>
         <input name="gender" id="genderm" type="radio" /> Male  <input name="gender" id="genderf" type="radio" /> Female
        </td>
    
    </tr>
    
    <tr>
        <td>
          <label for="email">Email :</label> 
        </td>
    
        <td>
         <input name="email" id="email" type="text" /> 
        </td>
    </tr>
    
    <tr>
        <td>
        <label for="address">Address :</label>
        </td>
    
        <td>
        <input name="addr" id="addr" type="text" /> 
        </td>
    </tr>
    
    <tr>
        <td>
        <label for="mob">Mobile Phone :</label>
        </td>
    
        <td>
        <input name="mob" id="mob" type="text" /> 
        </td>
    </tr>
    
    <tr>
        <td>
         <label for="dob">Date Of Birth (mm/dd/YYYY):</label>
        </td>
    
        <td>
        <input name="dob" id="dob" type="text" />     
        </td>
    </tr>
    
    <tr>
        <td>
         <label for="agreeT">By Checking This you agree to our Terms  :</label>
        </td>
    
        <td>
         <input name="agreeT" id="agreeT" type="checkbox" />
    
        </td>
    </tr>
    
       <tr>
        <td>
         <input type="submit" value="Sumbit" />
        </td>
    
    </tr> </table>
        </form>
    

    Your js code:-

    <script type="text/javascript">
    
    $().ready(function() {
        $("#contactform").validate({ 
    
        rules : {
            fname: "required",
            lname: "required",
            email: {
                email: true,
                required: true
            },
            gender:" required",
            addr: "required",
            dob: {
                required: true,
                date: true
            },
            agreeT: "required"
        },
    messages: {
        fname: "Please enter your name",
        lname: "Please enter your last name",
        email: "Please enter a valid email address"
    }
        });
    
    });
    
    
    </script>
    

    ————OR——————-

     <script language="javascript">
    $(document).ready(function() {
        $("#contactform").validate({ 
    
    rules : {
        fname: {required: true},
        lname: {required: true},
        email: {
            email: true,
            required: true
        },
        gender:{required: true},
        addr: {required: true},
        dob: {
            required: true,
            date: true
        },
        agreeT:{required: true}
    },
    messages: {
        fname: "Please enter your name",
        lname: "Please enter your last name",
        email: "Please enter a valid email address"
    }
    

    });
    });

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

Sidebar

Related Questions

I am sure this has been asked already, but I have been trying all
I'm new to Django, trying to process some forms. I have this form for
This is using jQuery 1.6.1 and Validate 1.8.1. I have been banging my head
I have been trying to validate my web page for the last two hours,
Ok, I have been staring at this for hours trying to figure out what's
I have the following html code: <form> <table> <tbody> <tr> <td> <span>Quantity<span class=pull-right>3</span> <input
Have have been trying to make a validator for my xml files. I have
I have been trying very hard to achieve rounded corners with IE6+jquery ui tabs.
I have been trying to us CALayers as sprites in an iPhone application I'm
I have been trying all afternoon to get the jQuery Sifr Plugin ( http://jquery.thewikies.com/sifr/

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.