"<script type='text/javascript'> $(function () { "+If(UntilDate<>NullDate(), "var untilDate = new Date("+Year(UntilDate)+","+(Month(UntilDate)-1)+","+Day(UntilDate)+"); $('#"+defaultCountdown.Id+"').countdown({until:untilDate, onExpiry: liftOff});", "var untilText = '"+UntilText+"'; if(untilText!=' ') $('#"+defaultCountdown.Id+"').countdown({until:untilText, onExpiry: liftOff}); else Alert('You need to define a valid date!'); ")+" }); function liftOff() { osjs('#"+BUTTON_OR_LINK_TO_CLICK.Id+"').click(); } </script>"
Hi,
I also have a requirement to trigger an action once the clock is reaching 0. Reading the solution above, I have created 1 link in the CountDown web block, name it to NewLink. The link calls a screen action. Then I changed the script as adviced:
function liftOff() { osjs('#"+NewLink.Id+"').click(); }
But it didn't trigger anything. Did I skip something on the implementation? Please kindly advice.
Thnx.
It turned out I skipped some part of the script. It works.
Thank you.