-
Add listener to keyboard question
Hi friends, I am kinda newbie with listeners and all that stuff, so I need your help with this.
I have a form with 4 entries, and a button who sends that info to a php file who will display the stuff.
I need to know how can I create a listeners that if some body press enter, the information is send as well. The form is buried 3 layers down from the root, same for the button. I know the next code is not correct, but just to give you and Idea of what I need
PHP Code:
keyListener = new Object(); keyListener.onKeyUp = function () { getURL("http://mysite.com/tracking.php", "_blank", "GET"); input = ""; input2 = ""; input3 = ""; input4 = ""; } Key.addListener(keyListener);
Last edited by pucca017; 08-01-2008 at 11:23 AM.
-
Senior Member
PHP Code:
keyListener = new Object();
keyListener.onKeyDown = function (){
if(Key.isDown(Key.ENTER)){
getURL("http://mysite.com/tracking.php", "_blank", "GET");
input = "";
input2 = "";
input3 = "";
input4 = "";
}
}
Key.addListener(keyListener);
If you don't think you're going to like the answer, then don't ask the question.
-
THank you man! it worked perfect!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|