Are there really noone who knows this?!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • IVer Erling Årva

    Are there really noone who knows this?!

    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.replac e(/^\s+/, "");
    el.value = el.value.replac e(/\s+$/, "");
    loginData[e] = el.value.toLowe rCase();
    }
    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(fil eURL,"lydwin");
    // location.href = fileURL;
    window.close();
    }
    img.src = loginData[0] + '/' + loginData[1] + '.gif';
    img = null;
    //return newWindow;
    }

    Thanks!
    iver@tda.no




  • Dr John Stockton

    #2
    Re: Are there really noone who knows this?!

    JRS: In article <3f058498$1@new s.broadpark.no> , seen in
    news:comp.lang. javascript, IVer Erling Årva <iver@tda.no> posted at Fri,
    4 Jul 2003 15:42:05 :-[color=blue]
    >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];[/color]


    Insert, at that point, test code something like

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

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

    --
    © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
    <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
    <URL:http://www.merlyn.demo n.co.uk/js-index.htm> JS maths, dates, sources.
    <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.

    Comment

    Working...