Hello everyone,
Given below is the code that I am using to submit a Form (which is actually a
JSP) to the server anytime I hit the enter key.
I have a number of checks for each field on the form that I validate using javascript.
When I enter a wrong value into one of the text boxes and hit the enter key, it validates that field and displays an alert box that the format of that field is wrong, but still submits the form to the server.
Could anybody help me with understand why this could be happening?
Chuck
---------------------------------------------------
netscape = "";
ver = navigator.appVersion; len = ver.length;
for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
netscape = (ver.charAt(iln+1).toUpperCase() != "C");
function keyDown(DnEvents)
{// handles keypress
// determines whether Netscape or Internet Explorer
k = (netscape) ? DnEvents.which : window.event.keyCode;
if (k == 13) {// enter key pressed
submitRequest();
}
}
---------------------------------------------------------