作者gckenny (绝体绝命!小君君的最期~)
看板PHP
标题Re: [请益] <form>的xhtml1.0 strict 检测 不能用n …
时间Fri Jan 6 09:25:22 2006
上一篇的推文都没先试试看嘛?XD
※ 引述《picachuxyz (XHTML&CSS&PHP)》之铭言:
执行js的时候,网页发生错误,不知道是js的问题还是html的问题?
<script type="text/javascript">
<!--
function send() {
if (document.
forms[0].email.value.length==0) {
alert("姓名不能空白");
return false;
}
if (document.
forms[0].subject.value.length==0) {
alert("主题不能空白");
return false;
}
if (document.
forms[0].message.value.length==0) {
alert("内容不能空白");
return false;
}
document.forms[0].submit();
}
// -->
</script>
<body>
<div id="content">
<form action="mailing.php" method="post">
<table id="mail">
<tr><td>你的e-mail</td><td><input type="text" name="email" size="30" />
</td></tr>
<tr><td>主旨</td><td><input type="text" name="subject" size="30" />
</td></tr>
<tr><td>内容</td><td><textarea cols="30" rows="6" name="message"></textarea>
</td></tr>
<tr><td colspan="2"><input type="button" value="送出" onclick="send()" />
<input type="reset" value="清除" /></td></tr>
</table>
</form>
</div>
</body>
</html>
很神奇的是,把id="mailform"改成name="mailform",就不会执行错误了><"?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.132.202.165
--
听说没有部落格,就是跟不上时代...囧rz
http://BLOG.Orz.tw [180禁!未成年勿浏览!]
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 219.84.65.198
※ 编辑: gckenny 来自: 219.84.65.198 (01/06 09:40)
1F:推 picachuxyz:试过了...失败>< 01/06 18:22