productTrials.html
4.7 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>学点云</title>
<link rel="stylesheet" type="text/css" href="css/reset.min.css">
<link rel="stylesheet" href="css/trials.css">
</head>
<body>
<div class="product_trial_formbox">
<div class="product_trial_formbox_head"><img src="images/apply-try.png" alt="免费申请试用"></div>
<div class="product_trial_formbox_content">
<p>留下您的联系方式,我们会有专人客服在一个工作日内和您联系。</p>
<form action="" id="detailForm" class="detailForm" method="post">
<label>* 姓名:</label>
<input name="user_name" type="text" autofocus="autofocus" value="" placeholder="输入您的姓名" title="请输入您的姓名">
<br>
<label>* 手机:</label>
<input name="phone_number" type="text" value="" placeholder="输入您的手机号码" title="输入您的手机号码">
<br>
<label>* 邮箱:</label>
<input name="email" type="text" value="" placeholder="输入您的邮箱地址" title="输入您的邮箱地址">
<br>
<label>公司:</label>
<input name="company" type="text" value="" placeholder="输入您的公司名称">
<br>
<label>电话:</label>
<input name="telphone" type="text" value="" placeholder="输入您的固定电话">
<br>
<label>
<a class="submit_trail" href="javascript:void(0)">立即申请</a></label>
</form>
</div>
</div>
<script type="text/javascript" src="js/rem.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.poshytip.min.js"></script>
<script type="text/javascript" src="js/validate.js"></script>
<script>
$(document).ready(function(){
$('.submit_trail').click(function(){
var obj = $(this);
var user_name=$("input[name=user_name]").val();
var phone_number=$("input[name=phone_number]").val();
var email=$("input[name=email]").val();
var company=$("input[name=company]").val();
var telphone=$("input[name=telphone]").val();
// var clientip = returnCitySN["cip"];
if(validate.isempty(user_name)){
$("input[name=user_name]").poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'right',
alignY: 'center',
offsetX: 5,
showTimeout: 100
});
$("input[name=user_name]").focus();
return false;
}
if(!validate.iscellphone(phone_number)){
$("input[name=phone_number]").poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'right',
alignY: 'center',
offsetX: 5,
showTimeout: 100
});
$("input[name=phone_number]").focus();
return false;
}
if(!validate.isemail(email)){
$("input[name=email]").poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'right',
alignY: 'center',
offsetX: 5,
showTimeout: 100
});
$("input[name=email]").focus();
return false;
}
jQuery.support.cors = true;
$.ajax({
url: "http://api.xuedianyun.com/sanmang/index.php/api/sendmail/sendmail",
type:'POST',
data:{email:email,user_name:user_name,phone_number:phone_number,company:company,telphone:telphone},
dataType: 'JSON',
success: function(res){
if(res.errcode == 0){
$('.info').show();
//alert("I am an alert box!!")
}else{
alert(res.msg);
}
},complete:function(){
$(':input').val('');
$('.info').slideToggle(2000);
obj.empty().text("立即申请");
alert(res.msg);
}
});
})
});
</script>
</body>
</html>