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

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

var username= $("#username").val();
var email = $("#email").val();
var dataString = "username ="+ username + "&email =" + email;
$.ajax({
type: "POST",
url: "check.php",
data:dataString,
success: function(msg){
if( msg =="ok")
{
$("#username").addClass("UserAvailable");
}
else
{
$("#userError").html('The username should have at least 4 characters.</font>');
}
});
});
});
</script>
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....