N
news.broadpark.no
I run this script in IE6 under WinXP and it works. I do the same with IE and
MAC and it doesn't. It seems like som strange characters are added to the
end of the password when it is returned to the program. Also, when I enter a
wrong username/password the alertbox telling me that this is the case
doesn't display most of the time.
Can anyone help please?
function checkLogin(form) {
loginData = [];
for (var e = 0; e < 2; e++) {
var el = form.elements[e];
if (el.value =="" || el.value == null) {
alert("Please enter " + el.name);
el.focus();
return false;
}
el.value = el.value.replace(/^\s+/, "");
el.value = el.value.replace(/\s+$/, "");
loginData[e] = el.value.toLowerCase();
}
var img = new Image();
var newWindow="";
//alert(loginData[0] + " " + loginData[1]);
img.onerror = function (evt) {
alert(Wrong username or password - please try again');
document.login.username.value = '';
document.login.password.value = '';
}
img.onload = function (evt) {
// alert('Valid login');
fileURL = loginData[0] + '/' + loginData[1] + '.htm'
newWindow = window.open(fileURL,"lydwin");
// location.href = fileURL;
window.close();
}
img.src = loginData[0] + '/' + loginData[1] + '.gif';
img = null;
//return newWindow;
}
Thanks!
(e-mail address removed)
MAC and it doesn't. It seems like som strange characters are added to the
end of the password when it is returned to the program. Also, when I enter a
wrong username/password the alertbox telling me that this is the case
doesn't display most of the time.
Can anyone help please?
function checkLogin(form) {
loginData = [];
for (var e = 0; e < 2; e++) {
var el = form.elements[e];
if (el.value =="" || el.value == null) {
alert("Please enter " + el.name);
el.focus();
return false;
}
el.value = el.value.replace(/^\s+/, "");
el.value = el.value.replace(/\s+$/, "");
loginData[e] = el.value.toLowerCase();
}
var img = new Image();
var newWindow="";
//alert(loginData[0] + " " + loginData[1]);
img.onerror = function (evt) {
alert(Wrong username or password - please try again');
document.login.username.value = '';
document.login.password.value = '';
}
img.onload = function (evt) {
// alert('Valid login');
fileURL = loginData[0] + '/' + loginData[1] + '.htm'
newWindow = window.open(fileURL,"lydwin");
// location.href = fileURL;
window.close();
}
img.src = loginData[0] + '/' + loginData[1] + '.gif';
img = null;
//return newWindow;
}
Thanks!
(e-mail address removed)