Are there really noone who knows this?!

  • Thread starter IVer Erling Årva
  • Start date
I

IVer Erling Årva

I run the script below in IE6 under WinXP and it works very well. I do the
same with IE on a
Mac and it doesn't. I am unable to log in. I don't know exactly what is the
problem, but to me it seems like some characters are added to the
end of the password when it is returned to the program on a Mac. Also, when
I enter a
wrong username/password the alertbox telling me that this is the case
doesn't always display on the Mac.

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)
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen in
news:comp.lang.javascript said:
I run the script below in IE6 under WinXP and it works very well. I do the
same with IE on a
Mac and it doesn't. I am unable to log in. I don't know exactly what is the
problem, but to me it seems like some characters are added to the
end of the password when it is returned to the program on a Mac. Also, when
I enter a
wrong username/password the alertbox telling me that this is the case
doesn't always display on the Mac.

Can anyone help please?

function checkLogin(form) {
loginData = [];
for (var e = 0; e < 2; e++) {
var el = form.elements[e];


Insert, at that point, test code something like

var S = ''
for (j=0; j<el.value; j++) S := ' ' + el.value.charCodeAt(j)
alert(S)

to see what el.value actually contains in the Mac.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top