I'm just learning JS. I've been able to convert all but a few lines of the original code. Can anyone help? Many thanks.
function ValidatePW(f)
{
var decryptedPW = f.ApprovalPassword.value
var offPW = f.OfficerPW.value;
var mgrPW = f.ManagerPW.value;
var pw = "";
var i, j;
// Begin VB Script
j = Len(decryptedPW) + 1
For i = 1 To Len(decryptedPW)
pw = pw & Chr((270 + i - Asc(Mid(decryptedPW, j - i, 1))) And 255)
Next i
// End VB Script
if ((pw == offPW) || (pw == mgrPW))
{
return true;
}
else
{
alert ("The password entered does not match either password."
return false;
}
}
function ValidatePW(f)
{
var decryptedPW = f.ApprovalPassword.value
var offPW = f.OfficerPW.value;
var mgrPW = f.ManagerPW.value;
var pw = "";
var i, j;
// Begin VB Script
j = Len(decryptedPW) + 1
For i = 1 To Len(decryptedPW)
pw = pw & Chr((270 + i - Asc(Mid(decryptedPW, j - i, 1))) And 255)
Next i
// End VB Script
if ((pw == offPW) || (pw == mgrPW))
{
return true;
}
else
{
alert ("The password entered does not match either password."
return false;
}
}