Solved

Chain multiple events for "onclick"?

Posted on 2013-05-14
4
464 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 33

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

831 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