为什么alert()后,总要打开新窗口?
wtoeb 2003-08-19 02:54:04 <html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<script>
function selectp()
{
if(document.myform1.pcode.value==""||document.myform1.pcode.value=="输入简码")
{
alert("没有输入简码啦");
document.myform1.pcode.focus();
return false;
}
}
</script>
</head>
<body>
<form name="myform1" method="POST" action="addok.jsp" target="sp">
<input type="text" name="pcode" size="12" value="输入简码" onMouseOver="this.focus()" onMouseOut="if(this.value=='')this.value='输入简码';" onFocus="this.select()" onClick="if(this.value=='输入简码')this.value=''">
<input type="submit" value="选择产品" name="sp" onclick="selectp()" style="height=20;width:60" tabindex="1">
</form>
</body>
</html>