<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form action="feedbackup.asp" method="post" name="gbook" id="gbook" onSubmit="return saveIt();">
<tr>
<td width="20%" height="50" align="right">您的姓名:</td>
<td width="30%" align="left"><input type="text" name="name" size="20" title="姓名" style="border:1px solid #ccc; height:20px; line-height:20px;"/>
<font color="#cc0000">*</font></td>
<td width="20%" align="right">E-mail:</td>
<td width="30%" align="left"><input name="email" type="text" id="email" title="email" size="20" style="border:1px solid #ccc; height:20px; line-height:20px;" /></td>
</tr>
<tr>
<td height="50" align="right">联系电话:</td>
<td align="left"><input type="text" name="phone" size="20" title="联系电话" style="border:1px solid #ccc; height:20px; line-height:20px;"/>
<font color="#cc0000">*</font></td>
<td align="right">QQ/MSN:</td>
<td align="left"><input name="qq" type="text" id="qq" title="qq" onKeyPress="event.returnValue=IsDigit();" size="20" style="border:1px solid #ccc; height:20px; line-height:20px;" /></td>
</tr>
<tr>
<td height="50"><div align="right">留言主题:</div></td>
<td colspan="3" align="left"><input type="text" name="title" size="42" title="主题" style="border:1px solid #ccc; height:20px; line-height:20px;"/>
<font color="#cc0000">*</font></td>
</tr>
<tr>
<td height="50" align="right">留言內容:</td>
<td colspan="3" align="left"><textarea name="content" cols="70" rows="5" wrap="virtual" title="详细信息" style="border:1px solid #ccc;"></textarea></td>
</tr>
<tr>
<td height="50"> </td>
<td colspan="3" align="left">
<input type="submit" value="确定提交" name="submit" class="buttom"/> <input type="reset" value="重新填写" name="reset" class="buttom"/>
</td>
</tr>
</form>
</table>
<script language="JavaScript" type="text/javascript">
function saveIt()
{
with(gbook)
{
if (name.value=="")
{
alert('请填写姓名!');
name.focus();
return false;
}
if (phone.value=="")
{
alert('请填写联系电话!');
phone.focus();
return false;
}
if (email.value.length!=0)
{
if(
email.value.charAt(0)=="."||
email.value.charAt(0)=="@"||
email.value.indexOf('@')==-1||
email.value.indexOf('.')==-1||
email.value.indexOf("@")==email.value.length-1||
email.value.lastIndexOf(".")==email.value.length-1
)
{
alert('E-mail地址格式不正确!');
email.focus();
return false;
}
}
if (title.value=="")
{
alert('请填写留言主题!');
title.focus();
return false;
}
if (content.value=="")
{
alert('请填写留言内容!');
content.focus();
return false;
}
if (content.value.length>400)
{
alert('留言内容太多!');
content.focus();
return false;
}
}
}
function IsDigit()
{
return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script>