aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Assign Two Methods at a Time 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 "Assign Two Methods at a Time" Watch "Assign Two Methods at a Time" New topic
Author

Assign Two Methods at a Time

ramnna jain
Ranch Hand

Joined: Mar 16, 2009
Posts: 129

Hi,

In my javascript code I want to assign two methods at a time:



I want to set another function 'checkAvailability()' on 'onblur', but how ... please any buddy can help me..!

Thank you.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

You can't when using Model 0 event handling.

You'll need to either:
  • enclose the two functions in the inline function
  • use DOM Model 2 event handling (warning! browser-specific minefield ahead)
  • user a library like jQuery that makes this easy

  • You're already enclosing the call to one function in an inline anonymous function, just add a second call.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 60053
        
      65

    For option 1 above:

    ramnna jain
    Ranch Hand

    Joined: Mar 16, 2009
    Posts: 129

    Thank you Bear... with your help the problem is solved... thank you again.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Assign Two Methods at a Time
     
    Similar Threads
    execute a function in a regular intervals
    little doubt
    backslash is removed from the parameter when javascript function get the parameter from java call
    Javascript statement does not get executed
    Enable the one drop down at a time