Submit a form using ajax after validation +jquery

hi to all,

I have a form and i am using jquery validation plugin to validate i want to after validation submit form using ajax.

here is the example.

<form id="frmRegister" action="" method="Post" >
<input type="text" id="username" name="username" value="" />

<input type="submit" id="btnRegister" name="btnRegister" value="Register" />


Now in validation i have following code

		rules: {
			username: {
			required: true
			messages: {
			username: "This field is required.",

Now after validation i want to submit using ajax

					type: "POST",
					url: "./ajax.php",
					data: "catid="+ categoryvalue,
					success: function(data)

How i validate first if validation is ok then submit form using ajax


Take a look at the submitHandler