$('#signup').click(function(event) {
event.preventDefault();
//validate and if it is valid serialize the form
//else alert and return
var isFormValid = true;
$(".signup-form .required input").each(function(index, value){
if ($.trim($(value).val()).length == 0){
$(value).parent().addClass("highlight");
isFormValid = false;
} else {
$(value).parent().removeClass("highlight");
}
});
if(isFormValid ){
$.post( 'validation.php', $('.signup-formt').serialize(), function( data ) {
});
}else{
alert("Please fill in all the required fields (highlighted in red)");
}
});