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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:48:05+00:00 2026-06-17T13:48:05+00:00

I used jquery validation ( http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ) for form validation. The followings are some

  • 0

I used jquery validation (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) for form validation. The followings are some fragments of my code:

HTML:

<form id="formID" action="/processForm" method="post">
  ...
  <input id="name" type="text" name="name" size="10" />
  <input id="username" type="text" name="username" size="10" />
  ...
<input type="submit" value="Submit" />

jQuery:

$("#formID").validate({
  onkeyup:false,

  rules: {
    name: {required: true},
    username: {required: true, checkUsername: true}
    ...
  },
  messages: {
    name: {required: "Must fill"},
    username: {required: "Must fill", checkUsername: "Username unavailable"},
    ...
  }

});

// Check if username exists
$.validator.addMethod('checkUsername', function(username) {
  var postURL = "/checkUsername";
  $.ajax({
    ...
  });
  return ...;
}, '');


// Submit the form by Ajax
$(document).ready(function() {
  $('.formID').ajaxForm({
    success: function(returnData) {
      $('#content').html(returnData);
    }
  });
});

Something odd is that I can leave some of the required fields blank or unchecked, and the form can still be submitted. Some required fields can prevent from submitting if left blank, but others don’t. Did anybody encounter the same strange problem? Or did I do anything wrong here?

BTW, if I click the submit button without filling anything, all required fields show error messages correctly. But some of them just won’t prevent the form from been submitted. Please help.

EDIT:
The Ajax form submission function at the bottom doesn’t seem to work. How do I correct it?

  • 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-17T13:48:07+00:00Added an answer on June 17, 2026 at 1:48 pm

    Summing up, in order to employ both form validation and ajax submission, add ‘submitHandler’ to the validate() function:

    $("#formID").validate({
      onkeyup:false,
    
      rules: {
        ...
      },
    
      messages: {
        ...
      },
    
      // Submit the form
      submitHandler: function(form) {
        theUrl = '/processData';
        var params = $(form).serialize();
        $.ajax ({
          type: "POST",
          url: theUrl,
          data: params,
          processData: false,
          async: false,
          success: function(returnData) {
            $('#content').html(returnData);
          }
        });
      }
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used http://bassistance.de/jquery-plugins/jquery-plugin-validation/ my form validate : $(#form_person).validate({ rules: { username: { required:
someone has used this jquery plugin for form validation? http://docs.jquery.com/Plugins/Validation i cant figure out
I'm using a great jQuery contact form validator from bassistance (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) is exactly what
jQuery Validation plugin is used to validate all form data: http://docs.jquery.com/Plugins/Validation Have 3 select
I am using the http://bassistance.de/jquery-plugins/jquery-plugin-validation/ plug in with the follow pseudo block that I
I used a JQuery Validation script for validating an HTML Form. This worked perfectly
I have the following page: http://valogiannis.com/freelancer/neurosport/register.html I use a validation jquery plugin: http://docs.jquery.com/Plugins/Validation When
I used the jquery.bassistance validation plugin. For validation on my fields. Now i want
I recently used jquery and the form validation plugin on a form we're testing
I have used jQuery plugin: Validation To validate some input fields, but I need

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.