views:

138

answers:

2

Hello all:

I have a input control (a Text Box) which has some javascript events associated with it (change, keypress, select, click). The first time my page is executed, I type some value in this input control and then click on my button. This button executes some ajax code, send some info to a application server and it is OK. Also, the Text Box related events are executed properly (these events runs some code that checks which controls have its values changed, so these changes can be sent to the server).

The 2nd time I type some value in this input control, the associated events are not executed properly, except if I first click outside the control and click inside the control again, so I can type some value and then then associated TextBox events are executed.

It only happens on IE7+, works fine on other browsers, like FF, Safari, Opera and Chrome. It seems that IE does not change the focus from the TextBox when I press my button and for some unknown reason, IE "forgets" about those events.

Just to clarify, my page consists of some HTML/JavaScript/AJAX code that communicates with a Application Server written in Delphi.

Please let me know if I was not clear enought and thanks for your time.

-- Jackson Gomes

A: 

I added a function that set the focus on the next element of the form in the onBlur event of my input element as a hack to my problem and it solves it (IE seems to re-recoginize the events if the focus moves to another control).

Now if I explicity set the focus on the input element again (even with the function call I described above), the problem appears.

I really do not understand why it happens and if it is a IE7+ bug or not.

The hack works, but if I want the focus on the input element, it does not.

:-(

-- Jackson Gomes

Jackson Gomes
A: 

How about moving the focus and then moving it back? Kinda like a blink...

General Jackson Tackett