Hi
I have a
jsp page. Page contains few html controls like text boxes.
It has a link whose href calls "submitRequest()", which should be activated when user clicks on it, or user presses the enter key. So I am catching the Enter key press in function "enter()" and calling function "submitRequest()" from "enter()" for validations. This function( submitRequest()) performs some validations on the text boxes and other controls on the page and show proper alerts if something is not valid.
To implement it I have applied the onkeydown event on the form instead of doing it on individual controls as I also have to catch the key press events for other combinations on the page say Alt+k, anytime on the page. Everything runs ok. But when the focus is on the link and I presses on Enter, first the enter() function gets called, which in turn call submitRequest() and show approprite alert if to be shown. After that the links href calls the same function and shows the same alert for the second time.
How could i prevent this function/alerts for the second time?
Thanks