B
brian.newman
I'm running the following function in Firefox. I've thrown the alerts
in to help figure out where the error is. The code terminates at the
line
var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which
: evt.keyCode);
I get no error in the javascript console, the code just stops cold (I
don't get the second alert message).
Do you have any idea why?
function parseDateField(evt) {
evt = (evt) ? evt : ((window.event) ? event : null);
if (evt) {
var elem = (evt.target) ? evt.target : evt.srcElement;
if (elem) {
alert ("break 1");
var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ?
evt.which : evt.keyCode);
alert ("charCode = " + charCode);
return true;
} else {
return false;
}
}
}
Its being called in the body of the page here
<INPUT TYPE="text" NAME="txtDate" id="txtDate" SIZE="9" MAXLENGTH="9"
onkeypress="parseDateField(this)">
in to help figure out where the error is. The code terminates at the
line
var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which
: evt.keyCode);
I get no error in the javascript console, the code just stops cold (I
don't get the second alert message).
Do you have any idea why?
function parseDateField(evt) {
evt = (evt) ? evt : ((window.event) ? event : null);
if (evt) {
var elem = (evt.target) ? evt.target : evt.srcElement;
if (elem) {
alert ("break 1");
var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ?
evt.which : evt.keyCode);
alert ("charCode = " + charCode);
return true;
} else {
return false;
}
}
}
Its being called in the body of the page here
<INPUT TYPE="text" NAME="txtDate" id="txtDate" SIZE="9" MAXLENGTH="9"
onkeypress="parseDateField(this)">