GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes how to fire the events when page loads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to fire the events when page loads" Watch "how to fire the events when page loads" New topic
Author

how to fire the events when page loads

giri shetty
Greenhorn

Joined: Jan 22, 2004
Posts: 27
Hi evereybody,
here i have a question i want to fire a event which presses down arrow button once and up arrow button once when page loads .

Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not have a function that acts like you are pressing the arrow keys, but I am assuming that you want the page to scroll?

If I am corrct with my assumption, then you can use the window.scrollBy() or window.scrollTo() menthods.

You can learn more about them here:
http://www.webreference.com/js/tutorial1/manipulate.html

OR

Do you want to detect a keypress of the arrows after the page has loaded?

Eric
giri shetty
Greenhorn

Joined: Jan 22, 2004
Posts: 27
Hi Eric ,
here i will explain what iam gonna do in my JSP page there are list of radio buttons iam putting the focus on the very first radio button here if fire the event which is "DOWN" arrow button pressed once and next "UP" arrow button pressed the focus is on the first button right. thats what ia want to do.it seems to be funny right but i need this one plese help me.

thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I think this should do it, you should replace the formName and also the radiobutton name with the correct values. I did not test this out to see if it works, I am not sure if it will. lol... Yell if it doesn't!



Eric
giri shetty
Greenhorn

Joined: Jan 22, 2004
Posts: 27
Thanks Eric,
I think this very useful for me.
 
GeeCON Prague 2014
 
subject: how to fire the events when page loads