I have below script:
$(function() {
$(".submit").click(function() {
var full_name = $("#full_name").val();
var cell_phone = $("#cell_phone").val();
var email = $("#email").val();
var dataString = 'full_name='+ full_name + '&cell_phone=' + cell_phone + '&email=' + email;
if (full_name=='' || cell_phone=='' || email=='')
{
$('.success').fadeOut(200).hide();
$('.error').fadeOut(200).show();
}
else
{
$.ajax({
type: "POST",
url: "join.php",
data: dataString,
success: function() {
$('.submit').fadeIn(200).hide();
$('.success').fadeIn(200).show();
$('.error').fadeOut(200).hide();
}
});
}
return false;
});
});
- How to make validate email.
- Only ( numbers + - ) and not less than 7 numbers for cell_phone filed.