View Full Version : Key Launcher works, but add a form to the equation?

Phil_at _work
08-26-2002, 08:35 AM
Basically I have got the Key Launcher to work brilliantly and everyone is happy, Then came the question,

What happens if there is a <input type="text"> in the page? :confused:

Well, when there is a form element in the page, I need to set focus to the form so that when I hit a defined "Hot Key" the page is not redirected and form field doesn't lose focus.

Can I set Focus to the form so that is escapes the document.onkeypress event?

Has any one gotten this to work?? if so any hints/tips

I have looked at other examples on the net and they all seem to suffer the same feat but Im sure there is a way I just haven't found it yet.



08-26-2002, 02:13 PM
document.formName.fieldName.onkeydown = function(e) {
if(typeof e.stopPropagation != "undefined") e.stopPropagation();
else event.cancelBubble = true;

Hope that helps!

Happy coding! :)

Phil_at _work
08-27-2002, 01:10 AM
Thanks for the reply, :thumbsup: I will let you know how it goes.