<script type="text/javascript" language="javascript">

$("#username").change(function() {

var username= $("#username").val();
var email = $("#email").val();
var dataString = "username ="+ username + "&email =" + email;
type: "POST",
url: "check.php",
success: function(msg){
if( msg =="ok")
$("#userError").html('The username should have at least 4 characters.</font>');
This is the code for validating only one input field.. i don't know how can i do for more than one input field
because on success: function(msg) it retrieving what ever is echo on check.php....