Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

Chain multiple events for "onclick"?

<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
Tom Knowlton
Asked:
Tom Knowlton
1 Solution
 
JHallidayCommented:
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
 
GaryCommented:
Get rid of the second javascript:
Are you sure the first function is actually returning?
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
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
 
Tom KnowltonWeb developerAuthor Commented:
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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now