This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes html:select event issue - I am not sure which event to use to remove focus Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "html:select event issue - I am not sure which event to use to remove focus" Watch "html:select event issue - I am not sure which event to use to remove focus" New topic
Author

html:select event issue - I am not sure which event to use to remove focus

kapil patel
Ranch Hand

Joined: Sep 30, 2005
Posts: 33
Hi friends,

We have requirements that when user clicks combo box and then enter, it should submit request.

However, when we select combo box, control is with combobox hence, I have to move focus to next element. I have created java function for that. However, my problem is following lists of events available:

onblur
onchange
onclick
ondblclick
onfocus
onkeydown
onkeypress
onkeyup
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup

Out of above, only onchange event seems possible. However, when I use this event to move focus, there is another problem. If User use mouse to select value in combobox, it works fine. But still if user does not change value and hit ENTER, I have same problem.

Moreover, If some user use keyboard to scroll through value and try to select. It will move focus when he scroll one value.

I tried all combinations but failed so far. Moreover, I tried to search on internet without success. Any guidance or idea would be much appreciated.

Anybody who has face problem and any solution would be really useful.

Thanks,
Kapil Patel
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
here's something that would work:



I tried this on both Internet Explorer and FireFox, and it worked for both browsers.
[ March 08, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: html:select event issue - I am not sure which event to use to remove focus
 
Similar Threads
How to distinguish between Netscape 6 and Mozilla
JComboBox problem
Combobox Problem
What type of listener can i use, instead of FocusListener
How to insert at runtime using AJAX