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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:56:50+00:00 2026-06-02T23:56:50+00:00

I tried to do everything by what I read..but jquery validation doesnt happen when

  • 0

I tried to do everything by what I read..but jquery validation doesnt happen when I submit the form. Here is my jquery:

(function ($) {

$('#registrationForm').validate({
    rules: {
        username: {
            required: true,
            minlength: 4
        },
        fullname: {
            required: true,
            minlength: 4
        },
        email: {
            required: true,
            minlength: 4,
            email: true
        },
        retype_email: {
            required: true,
            minlength: 4,
            email: true,
            nameField: { notEqual: "email" }
        },
        password: {
            required: true,
            minlength: 4
        },
        retype_password: {
            required: true,
            minlength: 4,
            nameField: { notEqual: "password" }
        },
        url: "url",
        comment: "required"
    },

    messages: {
        username: {
            required: "Please fill your name",
            minlength: "The name is too short"
        },
        fullname: {
            required: "Please fill your surname",
            minlength: "Your surname is too short"
        },
        email: {
            required: "Please fill your email",
            minlength: "Your email is too short",
            email: "Invalid email"
        },
        retype_email: {
            required: "Please retype your email",
            minlength: "Your email is too short",
            email: "This is an invalid email",
            nameField: "Your email doesnt match the email above"
        },
        password: {
            required: "Please fill in your password",
            minlength: "The password is too short"
        },
        retype_password: {
            required: "Please retype your password",
            minlength: "The password is too short",
            nameField: "Your password doesnt match the password above"
        }
    },
    submitHandler: function (form) {
        $(form).ajaxSubmit();
    },
    invalidHandler: function (e, validator) {
        var errors = validator.numberOfInvalids();
        if (errors) {
            var messages = errors == 1
           ? 'You have missed 1 field. It has been highlighted below'
           : 'You missed ' + errors + 'fields. They have been highlighted below';
            $("div.errors span").html(message);
            $("div.error").show();
        }
        else {
            $("div.error").hide();
        }
    }
});

jQuery.validator.addMethod("notEqual", function (value, element, param) {
    return this.optional(element) || value != param;
}, "Please specify a different (non-default) value");

})(jQuery);

Here is my html:

    <form action="" method="post" id="registrationForm" >    <table>

    <tr>

        <td>

            Sign up

        </td>

    </tr>

    <tr>

        <td>

            <input class="required" id="username" name="username" title="User name" type="text" value="" />

        </td>

    </tr>

    <tr>

        <td>

            <input class="required" id="fullname" name="fullname" title="Full name" type="text" value="" />

        </td>

    </tr>

    <tr>

        <td>

            <input class="required" id="email" name="email" title="Email address" type="text" value="" />

        </td>

    </tr>

    <tr>

        <td>

           <input class="required" id="retype_email" name="retype_email" title="Retype email" type="text" value="" />

        </td>

    </tr>

    <tr>

        <td>

           <input class="required" id="password" name="password" title="Password" type="text" value="" />

        </td>

    </tr>

     <tr>

        <td>

               <input class="required" id="retype_password" name="retype_password" title="Retype password" type="text" value="" />

            </td>

        </tr>
</table>
<input type="submit" name="register" value="Sign up" />
</form>

What am I doing wrong, why the form is submited and there are no errors shown whenever all the fields are empty?

UPDATE:

Uncaught TypeError: Object [object Object] has no method ‘validate’

  • 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-02T23:56:51+00:00Added an answer on June 2, 2026 at 11:56 pm

    I hope this is what you want.

    DEMO

    1. typo: In invalidHandler declared variable was message but messages was used in $("div.errors span").html(messages);
    2. changed namefield in retpye_password and retype_email to equalTo
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having an issue here that I have tried everything I can think of but
I've read every other thread on this and have tried everything but the Build
I've read about a dozen similar questions on here and tried everything I can
I read lot's of docs, tried everything and still can't understand why my template
I tried everything to debug this one but I can't get to the bottom
I search everywhere and tried everything I could, but I cannot make my second
I've searched for help and tried everything on this thread , but still can't
I've searched all over and tried everything but I still get: invalid multibyte char
I've read all about this online but everything else was just overly complicated and
I have tried everything I can think of and every code sample imaginable but

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.