Focus and onKeyUp event problem

H

hwait

Hello, people!
I know it was asked many times, but I haven't the decision yet.
The situation:
I have 3 frames, f1, f2 and f3. f3 has a link with code:
<a href='javascript:f1.func1();'>Smth.</a>
f1.func1() makes the form in f2, with one input field, and sets focus
to the field. This all works ok. I need to catch the enter and arrows
keys, therefore I catch onKeyUp event. The code for it:
<input name='name' id='1-12' type='text' class='input'
onKeyUp='t1.keyLinePressed(event.keyCode,this);'
onClick='t1.selField(this.id)' onBlur='if
(this.value==0)t1.keyLinePressed(13,this);'
onChange='t1.keyLinePressed(13,this);'>

The selField function sets the focus to the field using the:
timer=setTimeout("t2.form."+name+".focus();t2.form."+name+".select();",100);
where the name is a name of the input field.
It works fine too. The keyLinePressed() function rises up every time I
push a key.

The code catches next situations:
1) When user clicks the link again (form already has the input field)
system do nothing, only back the focus to the field.
2) When user pushes Enter key with wrong inputs system alerts him and
also backs the focus to the field.

And here is the problem:
the focus moves back, and selects the text inputed, user can type new
digits, BUT the onKeyUp doesn't rise! If I move focus by pressing TAB
button - the onChange rises.
I didn't found the answer here in the conference. I don't know what to
do.
Any Ideas?
Thanx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top