Solved

Chain multiple events for "onclick"?

Posted on 2013-05-14
4
474 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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

636 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