I have a JSP page I'm trying to debug. Let me explain briefly.
There's a form, with text input fields in a grid (several rows) for account numbers.
There are also several buttons in the form, of interest is what is called in the app as the Approve button.
The way it was built, after a user enters a value in the account_number input field, the onblur event calls a funciton to do some validation.
That works when the user tabs out of the field.
The problem is this. If a user enters a value, and DOES not tab out of the field, but instead clicks the Approve buttons the onblur event is not executed. The validation is then bypassed.
I don't know why onblur event is not triggered when user clicks Approve, but it is when a user tabs out.
Anyone know why that is?
We have an onclick event with the Approve button, but prior to performing that, we want the data validation first performed, which is "tied" to the onblur event.
One thing that may work is the onchange event for the text input field. I put some displays and it seems to trigger that event, both when I tab out of the field, and when I click the button.
I was going to use: onchange ="foo()"
Is there a way in javascript to find out if the Approve button was clicked. Something like:
function foo() {
if Approve_button clicked, then do something....
}
Thanks.