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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:48:54+00:00 2026-05-18T10:48:54+00:00

my form validation does not firing…if i try to submit this form without entering

  • 0

my form validation does not firing…if i try to submit this form without entering anything then it should validate but in this case it does accept the form.

<script src="Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.validate.min.js" type="text/javascript"></script>

<script>
    $(document).ready(function () {
        $("#register").click(function (event) {
            // validate the comment form when it is submitted  
            // validate signup form on keyup and submit
            $("#form1").validate({
                rules: {
                    firstname: "required",
                    lastname: "required",
                    //city: "required",
                    state: "required",
                    country: "required"
                },
                messages: {
                    firstname: "Please enter your firstname",
                    lastname: "Please enter your lastname",
                    //city: "Please enter a valid email address",
                    country: "Please select your country"
                }
            });
            $("#form1").validate({
                submitHandler: PostData
            });


            function PostData() {

                $.ajax(url, { Id: '1' },
                       function (data, textStatus) {
                           //alert(textStatus);
                       });
            }

        });
    });
</script>
<div id="content-main">
    <div class="main-inner">
        <form id="form1" class="toolTip hasCorners" name="form1" action="http://site.com/"
        onsubmit="return false;" method="post">
        <fieldset>
            <div class="fontWeight7">
                <input type="radio" value="1" name="pledge_level" class="required">
                <p class="radioText">
                    Iam on vacation.</p>
                <label for="level1" class="error">
                    Please select</label>
            </div>
            <p class="required-msg">
                All fields below are required</p>
            <div class="subColumns paragraph">
                <div class="lefty">
                    <div class="fontWeight7">
                        <label for="first_name">
                            First Name:</label>
                        <input id="first_name" class="text hasCorners required" name="first_name" type="text"
                            maxlength="200" value="">
                        <label for="level1" class="error">
                            Please enter your name!</label>
                    </div>
                </div>
                <div class="cdc-left">
                    <div class="fontWeight7">
                        <label for="last_initial">
                            Last Initial:</label>
                        <input id="last_initial" class="text hasCorners required" name="last_initial" type="text"
                            maxlength="200" value="">
                        <label for="level2" class="error">
                            Please enter your last initial!</label>
                    </div>
                   <rest of the code here .... >
                </div>
            </div>

<input id="register"   name="register" value="Submit Your form"
                                    type="submit">
  • 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-18T10:48:55+00:00Added an answer on May 18, 2026 at 10:48 am

    The .validate should be done once the document is ready, not on the click of the button. So take it out from there.

    e.g.

    $(document).ready(function () {
        $("#form1").validate({
                rules: {
                    firstname: "required",
                    lastname: "required",
                    //city: "required",
                    state: "required",
                    country: "required"
                },
                messages: {
                    firstname: "Please enter your firstname",
                    lastname: "Please enter your lastname",
                    //city: "Please enter a valid email address",
                    country: "Please select your country"
                },
                submitHandler: PostData
            });
        });
    });
    
    function PostData() {
        $.ajax(url,
               { Id: '1' },
               function (data, textStatus) {
                   //alert(textStatus);
               });
    }
    

    HTHs,
    Charles

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

Sidebar

Related Questions

Any recommendations for a javascript form validation library. I could try and roll my
Form validation for check boxes only seems to be working in IE....? Anyone have
I am trying to do some very simple form validation checking for null or
I'm looking for an easy to use, reasonably complete form validation solution for php.
I'm building an ASP.NET MVC application with a form that needs validation. The majority
In good old MFC, the DDX routines would have built in validation for form
I'm using form_remote_for() to do validation on a form's data so that my rails
Where do you put user input validation in a web form application? View: JavaScript
Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators? For
I'm using a bunch of different asp.net validation controls on a web form. Some

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.