Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: Problem with FF Date: Sun, 10 Jun 2012 13:31:21 -0600 Lines: 87 Message-ID: X-Trace: individual.net Dgs8SRxLQFSLZJs3CAWaDgtvuoICICzPW867Mc0sRe3tX6CdxukxrT+UuWkz1xVezh Cancel-Lock: sha1:zArWoCfrGU57ljgAUzmIdJ9C7MI= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Xref: csiph.com comp.lang.javascript:14433 Hi: I'm having a problem with FireFox in the code below. However, IE 7 and Chrome work properly. My code below is surely suspect :(( Would someone suggest a correction so that FF, Chrome, and IE work in the same fashion: i.e., operation returns to my password box with every keystroke except and I have commented the place where FF signals the error: " e is undefined ", this error occurs every time I enter a character in my password text input box. Thank you ! -- Mel Smith ************ Here's relevant code ************ function submitpwd() { if (!e) var e = window.event ; // for the next line, FF says: 'e is not defined'. However, IE and Chrome perform properly var nkey = e.charCode ? e.charCode : e.keyCode ; if ((nkey != 9) && (nkey != 13) ) { return true ; } if(event.stopPropagation) { event.stopPropagation ; } event.cancelBubble = true ; /* // I've tried with and without calling stopEvent(). There is no difference. stopEvent(e) ; */ var pwdval = "" ; var el = document.getElementById("ipwdfld") ; pwdval = alltrim(el.value) ; if (pwdval.length < 5) { window.alert("Password must 5 or 6 digits. Please Fix.") ; return false ; } var pwd = document.getElementById("ipwd") ; pwd.value = pwdval; // set it to the input value for server to access var drawel = document.getElementById("idraw") ; drawel.value = clubdraw ; // fill in the hidden fields for the server var pwddivel = document.getElementById("ipassword") ; pwddivel.style.display = "none" ; var msgel = document.getElementById("imessage") ; msgel.style.display = "inline" ; formel = document.getElementById("iformmenu") ; formel.submit() ; return true ; } function stopEvent(e) { if(!e) var e = window.event; //e.cancelBubble is supported by IE - this will kill the bubbling process. e.cancelBubble = true; e.returnValue = false; //e.stopPropagation works only in Firefox. if (e.stopPropagation) { e.stopPropagation(); e.preventDefault(); } return false; } **************** end of code **************