/
feedback.htm
162 lines (152 loc) · 5.1 KB
/
feedback.htm
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> feedback </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="editplus">
<meta name="author" content="">
<meta name="keywords" content="">
<meta name="description" content="">
<style type="text/css">
html {
height:100%;
}
body {
overflow:hidden;
margin:0;
padding:0px;
background:#000;
font:normal 12px Verdana;
height:100%;
}
.box {
vertical-align:top;
margin-left:100px;
margin-top:50px;
}
.box .tt {
color:#ccc;
font:normal 12px Verdana;
float:left;
}
.ipt {
font:normal 12px Verdana,宋体;
border:1px solid #FFFFCC;
background:#FFFFCC;
outline:none;
}
.tar {
font:normal 12px Verdana,宋体;
color:#000;
background:#FFFFCC url(message.gif) repeat-y 0 0;
width:400px;
height:240px;
overflow:auto;
border:1px solid #FFFFCC;
line-height:16px;
resize: none;
outline:none;
}
a {
font:normal 12px Verdana,宋体;
color:#FF6600;
text-decoration:none;
position:relative;
top:-2px;
}
</style>
<!-- button control begin -->
<script language="javascript" src="demo/core/button/button/btn.js"></script>
<link href="demo/core/button/button/btn.css" type="text/css" rel="stylesheet">
<!-- button control end -->
<!-- MessageBox begin -->
<script language="javascript" src="demo/core/MessageBox/js/MessageBox.js"></script>
<link href="demo/core/MessageBox/css/MessageBox.css" type="text/css" rel="stylesheet">
<!-- MessageBox end -->
</head>
<body scroll=no>
<form action='demo/service/feedback.asp' method='post' id='backForm' target='hidden_frame'>
<div class="box">
<span class="tt">昵称:</span><input type='text' class='ipt' id='nickName' name='nickName' onkeypress='if(event.keyCode==13){ok(); return false;}' /> <a href="javascript:void(0);" onclick="location.href='demo/service/feedbackshow.asp'">查看留言</a>
<div style="height:2px;"></div>
<span class="tt">内容:</span><textArea class='tar' id='backInfo' name='backInfo' />请输入内容</textArea>
<p/>
<table width=150 style="margin-left:170px;">
<tr>
<td align=left width=50%><div type="btn" img="demo/core/button/button/icon/accept.gif" onclick="ok();" value="提交"></div></td>
<td align=left><div type="btn" img="demo/core/button/button/icon/cancel.gif" onclick="no();" value="清空"></div></td>
</tr>
</table>
</div>
</form>
<iframe name="hidden_frame" id="hidden_frame" style="display:none"></iframe>
<script language="javascript">
$ = function(id){return document.getElementById(id);};
var t = $("backInfo"),reg = /(\s*)|(\s*$)/g;
$("nickName").focus();
t.onfocus = function(){
if(this.value.replace(reg,"") == "请输入内容")
this.value = "";
}
t.onblur = function(){
if(this.value.replace(reg,"") == "")
this.value = "请输入内容";
}
function ok(){
var nickName = $("nickName"),backInfo = $("backInfo");
if(nickName.value.replace(reg,"") == ""){
(new MessageBox(nickName)).Show("请输入昵称");
nickName.focus();
return;
}
if(backInfo.value.replace(reg,"") == "" || backInfo.value.replace(reg,"") == "请输入内容"){
(new MessageBox(backInfo)).Show("请输入留言内容");
backInfo.focus();
return;
}
if(nickName.value.RelLen() > 15){
(new MessageBox(nickName)).Show("昵称名称太长了吧");
nickName.focus();
nickName.select();
return;
}
if(backInfo.value.RelLen() > 500){
(new MessageBox(backInfo)).Show("留言内容长度不要大于500个字符啊... 我的虚拟主机没那么大方地...");
backInfo.focus();
return;
}
var form = $("backForm");
//Public.showWaitingLayer();
form.submit();
var iframe = $("hidden_frame");
if(iframe.attachEvent){
iframe.attachEvent("onload",function(){
done();
});
}else{
iframe.onload = function(){
done();
}
}
}
function no(){
var nickName = $("nickName"),backInfo = $("backInfo");
nickName.value = "";
backInfo.value = "请输入内容";
}
function done(){
//iframe.src="about:blank";
document.location.href = "demo/service/feedbackshow.asp";
}
String.prototype.RelLen = function(){
var str = this;
try{
var reg = /[^\x00-\xff]/g;
return str.replace(reg,"xx").length;
}catch(e){
return str.length;
}
}
</script>
</body>
</html>