2 回答

TA貢獻(xiàn)1951條經(jīng)驗(yàn) 獲得超3個(gè)贊
這樣就行了:
<form name="form" action="Chenking.jsp" method="post">
<input type="submit" value="提交" onchange="name();"/>
美女,測試了下你的代碼,js好像有問題。或者按我這樣寫也可以:
<html>
<head>
<title>LOGIN</title>
</head>
<body>
<form name="form" action="Chenking.jsp" method="post">
<h1>注冊頁面</h1>
姓 名:<input type="text" name="name" size="20" id="name"/><br>
密 碼:<input type="password" name="password" size="20" /><br>
確認(rèn)密碼:<input type="password" name="password1" size="20" /><br>
性 別:<input type="radio" name="sex" value="boy" checked="checked"/ >男
<input type="radio" name="sex" value="gril"/>女<br>
郵 箱:<input type="text" name="mali"/><br>
<br>
<input type="submit" value="提交" onClick="return check();"/> <input type="submit" value="重置"/></br>
</form>
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function check()
{
if(checkspace(document.form.name.value)) {
document.form.name.focus();
alert("再見了,美女!");
return false;
}
}
//-->
</script>
</body>
</html>
如果還有問題,你可以hi偶,或者你留下Q,偶告你,這里不方便,有字?jǐn)?shù)限制。ok
- 2 回答
- 0 關(guān)注
- 4008 瀏覽
添加回答
舉報(bào)