Solved

Chain multiple events for "onclick"?

Posted on 2013-05-14
4
463 Views
Last Modified: 2013-05-14
<a onclick="javascript:return CheckPostponeDate('5/15/2013 11:59:00 PM', 'ctl08_gvPendingTasks_ctl03_txtPostpone', 'ADMIN');javascript:return CheckCommentEmpty('');" id="ctl08_gvPendingTasks_ctl03_lnkPostpone" href="javascript:__doPostBack('ctl08$gvPendingTasks$ctl03$lnkPostpone','')">Postpone</a>


I am attempting to have the following two methods called in sequence after onclick fires:

CheckPostponeDate( )
and
CheckCommentEmpty( )

CheckPostponeDate seems to fire okay.

CheckCommentEmpty( ) does not work.


I first need to know if this kind of chaining of method calls is even valid in Javascript.
0
Comment
Question by:knowlton
4 Comments
 
LVL 5

Accepted Solution

by:
JHalliday earned 500 total points
ID: 39165568
Can you not add a call in the first method to run the second method ? I'm not sure its possible the way you want it to work above
0
 
LVL 58

Expert Comment

by:Gary
ID: 39165616
Get rid of the second javascript:
Are you sure the first function is actually returning?
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39165620
i think just creating one generic function and putting those 2 functions inside them would be the way to go. you also need to make sure you're returning true/false in your specific functions
0
 
LVL 5

Author Closing Comment

by:knowlton
ID: 39165629
I think your suggestion will work.

I thought about doing this.  I am not sure now why I rejected it as a solution.

Anyway, thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now