aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Event" Watch "Event" New topic
Author

Event

Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

Hello,i'm a beginner in javascript, so can you please guide me,

I'm doing registration form , based on different event i want to do different things , like if the event is onsubmit() or onblur() i want to do different thing, in my javascript, how to know from which(Eventnsubmit,onblur....) this method was invoked ?

thank you
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

Just establish different methods for the different events.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Faisal Fuad
Ranch Hand

Joined: Jul 05, 2011
Posts: 76

Arun, please have the basic ideas from these sites. Hope that will help you a little:

http://www.w3schools.com/js/js_events.asp
or
http://www.w3schools.com/jsref/event_onblur.asp
or
http://homepage.ntlworld.com/kayseycarvey/jss3p3.html

Best wishes
Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

Bear Bibeault wrote:Just establish different methods for the different events.

it's a drag, if i can come to know what Event happened based on that i can to manipulation single method is enough
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

It's a poor practice to have one method do completely disparate things based upon some input or other factor. Rather, create a method for each different action. It's not a drag, it's good engineering.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Event
 
Similar Threads
JWebUnit: How to trigger onblur Javascript event handler?
Validation in Struts
onblur, onchange, button clicked
How do I update the values in my selectOneMenu?
Assign Two Methods at a Time