basicInformationmod.js
1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* Created by mac on 17/9/12.
*/
(function () {
//提交事件
$('#ifo_submit').on('click',function () {
var flagAjax = 0;
var peo_text = $.trim($('#peo_text').val()),
peo_pho = $.trim($('#peo_pho').val()),
peo_email = $.trim($('#peo_email').val());
var reg = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$");
//负责人
if(peo_text == ''||peo_text == null||peo_text == undefined){
$('#peo_text').next().html('请输入负责人');
flagAjax --;
}else{
$('#peo_text').next().html('');
flagAjax ++;
};
//联系电话
if(peo_pho == ''||peo_pho == null||peo_pho == undefined){
$('#peo_pho').next().html('请输入手机号');
flagAjax --;
}else if(!/^1(3|4|5|7|8)\d{9}$/.test(peo_pho)){
$('#peo_pho').next().html('请输入正确手机号');
flagAjax --;
}else{
$('#peo_pho').next().html('');
flagAjax ++;
};
//邮箱
if(peo_email == ''||peo_email == null||peo_email == undefined){
$('#peo_email').next().html('请输入邮箱');
flagAjax --;
}else if(!reg.test(peo_email)){
$('#peo_email').next().html('请输入正确邮箱');
flagAjax --;
}else{
$('#peo_email').next().html('');
flagAjax ++;
};
console.log(flagAjax)
if(flagAjax == 3){
//请求接口ajax
//ajax 成功后跳转basicInformation.html; window.location.href = "basicInformation.html"
}else{
return false;
}
});
//取消事件
$('#ifo_cancle').on('click',function () {
alert('取消后,您所。。。。')
});
})();