81,115
社区成员
发帖
与我相关
我的任务
分享<html>
<head>
<title>ere</title>
<SCRIPT LANGUAGE="JavaScript">
function Checkok(inputName) {
if(inputName=='no') return true;
if(inputName=='yes') {
if(document.all("qw").value == "") {
alert("不能为空!");
document.all("qw").focus();
return false;
} else {
return true;
}
}
}
</Script>
</head>
<body>
<form method="post" action="Ok.jsp">
<table>
<tr>
<td><INPUT TYPE="text" NAME="q" value="333"> <INPUT
TYPE="text" NAME="qw" value=""></td>
</tr>
<tr>
<td><input type='submit' name='no' value='Agree' onclick=Checkok('no')>
<input type='submit' name='yes' value='Disagree' onclick=Checkok('yes')>
</td>
</tr>
</table>
</form>
</body>
</html><html>
<head> <title> ere </title> </head>
<body>
<form method="post" action="ok.jsp" onsubmit="return Checkok();">
<table>
<tr> <td>
<INPUT TYPE="text" NAME="q" value="333">
<INPUT TYPE="text" NAME="qw" value="">
</td> </tr>
<tr> <td>
<input type='button' onclick="gotoOtherPage()" name='no' value=' 不同意 '>
<input type='submit' name='yes' value=' 同意 '>
</td> </tr>
<table>
</form>
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
function Checkok()
{
if(document.all("qw").value == "")
{
alert("不能为空!");
document.all("qw").focus();
return false;
}else
{ return true; }
}
function gotoOtherPage(){
... 写你的代码吧!
}
</Script>