Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Chain multiple events for "onclick"?

Posted on 2013-05-14
4
Medium Priority
?
487 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:Tom Knowlton
4 Comments
 
LVL 5

Accepted Solution

by:
JHalliday earned 2000 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 34

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:Tom 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…
Suggested Courses

885 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