E-mail表单递交
</head>
<body >
<script language="javascript">
<!--
function validate_form() {
validity = true;
if (!check_empty(document.form.name.value))
{ validity = false; alert('对不起!请你填入你的姓名。'); }
if (!check_email(document.form.email.value))
{ validity = false; alert('对不起!请重新正确填入email地址。'); }
if (!check_empty(document.form.description.value))
{ validity = false; alert('对不起!请你在"简要描述"留言填入留言。'); }
if (validity)
alert (" 谢谢你的来信. "
+ " 你所填的信息将以email形式发送给我, "
+ " 假如你认为本站内容不错的话,请将本 "
+ " 介绍给你的朋友,希望大家经常光顾本站。");
return validity;
}
function check_empty(text) {
return (text.length > 0);
}
function check_email(address) {
if ((address == "")
|| (address.indexof ('@') == -1)
|| (address.indexof ('.') == -1))
return false;
return true;
}
// -->
</script>
<form name="form" method="post" action="mailto:xiaoqinglu@263.net?subject=网友的留言"
enctype="text/plain" onsubmit="return validate_form()">
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="77%">
<div align="left"><font size="3"><b>姓名:</b></font>
<input type="text" size=46 name="name">
<br>
<b><font size="3">email地址: </font></b>
<input type="text" size=46 name="email">
<br>
<b><font size="3">url地址: </font></b>
<input type="text" size=46 name="url" value="http://">
<br>
<b><font size="3">留言内容:</font></b><br>
<textarea name="description" rows=8 cols=45 wrap=virtual></textarea>
</div>
</td>
</tr>
<tr>
<td>
<div align="center"><br>
<input type="submit" name="submit" value="发送">
<input type="reset" value="清除" name="reset">
</div>
</td>
</tr>
</table>
</form>
</body></html>
下一篇: 突破空格的限制