我试图在员工ID
下输入变量时显示值(员工姓名)这是本地hta上传到我们的服务器
我仍然希望有人能帮助我这里是剧本
<title>Test Login</title>
<head>
<HTA:APPLICATION
ID="TestLogin"
APPLICATIONNAME="Login"
SysMenu="no"
BORDER="thin"
CONTEXTMENU="no"
ICON="images/help.ico"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
window.resizeTo 400,250
RESIZE="no"
SCROLL="no"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal" />
</head>
<body STYLE="font:14 pt arial; color:white;
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr='#000000', EndColorStr='#0000FF')">
<script type = "text/javascript">
var count = 2;
function validate() {
var un = document.myform.username.value;
var pw = document.myform.pword.value;
var valid = false;
var unArray = ["4020004", "4020031", "4020025",];
var pwArray = ["4020004", "4020031", "4020025",];
for (var i=0; i <unArray.length; i++) {
if ((un == unArray[i]) && (pw == pwArray[i])) {
valid = true;
break;
}
}
if (valid) {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("CALL MAIN WINDOW", 1, false);
return false;
}
var t = " tries";
if (count == 1) {t = " try"}
if (count >= 1) {
alert ("Invalid username and/or password. You have " + count + t + " left.");
document.myform.username.value = "";
document.myform.pword.value = "";
setTimeout("document.myform.username.focus()", 25);
setTimeout("document.myform.username.select()", 25);
count --;
}
else {
alert ("Still incorrect! You have no more tries left!");
document.myform.username.value = "No more tries allowed!";
document.myform.pword.value = "";
document.myform.username.disabled = true;
document.myform.pword.disabled = true;
return false;
}
}
</script>
<SCRIPT Language="VBScript">
</script>
<div style="text-align: center;"><img src="#" alt="#" align="middle" width="200" height="200">
<p>
<p>TEST LOGIN</p>
<form name = "myform">
<p>Staff ID <input type="text" name="username"> </p>
**TRYING TO SHOW STAFF NAME HERE WHEN ID IS ENTER**
<p>Password <input type="password" name="pword"></p>
</form>
这是原始脚本http://www.javascriptkit.com/script/script2/loginpass2.shtml
提前thanx
答案 0 :(得分:0)
因为您使用的是外部脚本,所以我无法真正找到您存储ID的位置。 在代码中的某处添加以下内容,以显示员工姓名:
<div class="staff-name-placeholder">Enter ID</div>
修改输入:
<p>Staff ID <input type="text" name="username"> </p>
要:
<p>Staff ID <input type="text" name="username" onchange="updatestaff();"> </p>
在页面底部添加以下内容:
<script type="text/javascript">
function updatestaff()
{
document.getElementById('staff-name-placeholder').innerHTML='[PLACE ID]';
}
</script>
它执行以下操作:
当然,还没有给出真实身份,你必须通过其他脚本传递它。
我希望这会有所帮助。