【发布时间】:2015-11-23 15:50:56
【问题描述】:
我有以下脚本:
$(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;
});
});
- 如何制作验证邮件。
- 只有 (numbers + -) 且不少于 7 个号码的手机号码。
【问题讨论】:
-
1
<input type=email> -
另一种选择是简单的正则表达式
-
使用正则表达式youtube.com/watch?v=qmuXqZi3r5M进行最佳电子邮件验证
-
还有phone
标签: javascript jquery ajax