1. password.html:
<html>
<head>
<title>Password</title>
<script language="javascript">
function CloseWin(bCheckPass)
{
if (bCheckPass)
{
if (document.pwdform.pwd.value == "")
{
alert("Please enter a valid password");
document.pwdform.pwd.focus();
return;
}
else
{
window.returnValue = document.pwdform.pwd.value;
}
}
window.close();
}
</script>
</head>
<body>
<form name="pwdform">
<table>
<tr>
<td>Please enter your password:</td>
<td><input type="password" name="pwd"></td>
</tr>
<tr>
<td align="right"><input type="button" value="OK" onclick="CloseWin(true)"></td>
<td><input type="button" value="Cancel" onclick="CloseWin(false)"></td>
</tr>
</table>
</form>
</body>
</html>2. usepassword.html:
<script language="javascript">
var pwd = showModalDialog("password.html",null,"dialogHeight:100px;dialogWidth:400px;status:no;help:no;resizable:no; edge: raised; center: yes; ");
if (pwd)
alert(pwd);
</script>
<html>
<head>
<title>Password</title>
<script language="javascript">
function CloseWin(bCheckPass)
{
if (bCheckPass)
{
if (document.pwdform.pwd.value == "")
{
alert("Please enter a valid password");
document.pwdform.pwd.focus();
return;
}
else
{
window.returnValue = document.pwdform.pwd.value;
}
}
window.close();
}
</script>
</head>
<body>
<form name="pwdform">
<table>
<tr>
<td>Please enter your password:</td>
<td><input type="password" name="pwd"></td>
</tr>
<tr>
<td align="right"><input type="button" value="OK" onclick="CloseWin(true)"></td>
<td><input type="button" value="Cancel" onclick="CloseWin(false)"></td>
</tr>
</table>
</form>
</body>
</html>2. usepassword.html:
<script language="javascript">
var pwd = showModalDialog("password.html",null,"dialogHeight:100px;dialogWidth:400px;status:no;help:no;resizable:no; edge: raised; center: yes; ");
if (pwd)
alert(pwd);
</script>
解决方案 »
- 急!!找一个有关VS2005+SQL2000WEBWINF和动态网站的系统,
- 怎么把整形数值转换成时间???????
- 关于qq-我的好友列表收缩效果?
- 如何防止用户恶意刷新!谢谢
- 请教高手——如何使用正则表达式判断格式为“mm/dd/yyyy”(类似"20/7/2006")的字符串,利马给分,多谢了!!
- 关于数组形式的表单计算,请高手帮我转成多行可计算的表单!
- window.location.href='index.jsp'中的"location"是什么意思?(100分,回答全者给分多)
- 能否将表单内容提交到showModalDialog()中?
- 在javascript中怎样调用asp.net中的函数或事件
- 请问:最新的javascript版本是多少?
- 请问网络编程,学什么语言好?(或者说更有发展前途)
- 请教在表格里插入一行的代码,要netscape支持的!
window.prompt实现吗?