Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to fire the events when page loads

 
giri shetty
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric,
I think this very useful for me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic