Running jquery form validation and jquery form post script together


I have 2 different scripts, one is jquery post for form, and second is jquery form validation.

I run post script at submit button click action, so it takes effect before validation :/ and i could not change validation to run before post script :( so now it form submitting without validating.

How can make it? Appreciate helps!

JQuery POST code

$(function() {

  $("#btnsend").click(function() {

    	var dataString = 'fullname='+ escape(;
    	  type: "POST",
    	  url: "query.php?act=sendMail",
    	  data: dataString,
    	  success: function() {

            		          .fadeIn(500, function() {$('#contact-form').append("");});


        return false;


JQuery Validation

thanks for plugin

<!-- Form Validation -->
<script src="inc/validation/jquery.validate.js" type="text/javascript"></script>
<script src="inc/validation/js/cmxforms.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="inc/validation/css/validation.css" media="screen" />

<script type="text/javascript">
$(document).ready(function() {


<form id="commentForm" name="contact" method="post" action="">
    <ul id="contact-form">
        <li><label for="full_name">Full Name: *</label><input type="text" name="full_name" id="full_name" class="txt_input required" /></li>
        <li class="alignRight"><input type="submit" value="Send" id="btnsend" name="btnsend" class="btn_submit" /></li>

$("#commentForm").validate( {
   submitHandler: function(form) {
      // validation success, do something

Call your ajax submit from within the success function callback.

Check: for more info (I assume we are talking about the same plugin).

This video can help you solving your question :)
By: admin