Jump to content

Timer/Delay on Button


RyanCote

Recommended Posts

Heres my issue, I am looking for help to had a simple 15sec delay timer on the <?php print $next_pg; ?> button that exist. I know enough about coding to be able to read it, (very slowly), however i don't know enough to be able to right it myself. Long ago a colleague of mine contracted out some work to his friend to code a course into my webpage. The colleague is no longer employeed with me and his friend wants me to pay him lots to add this in.

This section of code is used on every single page of the course, (it is the Navigation Bars).

 

I've tried to do it myself using....

setTimeout

and

hide().delay()

 

but i have no idea where to actually insert my coding into the existing coding to make this work.

 

#################################################################################

<td width="117">
        
    <?php if ($enable_next_button == "yes") {
            // very last quiz of Module 5 should reveal I Agree button and it is required, thus we should enforce it...
            // the JavaScript checkAcceptance() function is defined on the module_5_18 page, as well as "i_agree" form with
            // acceptance checkbox.
            if ($_SESSION['module5_5_completed'] == 1 && $pg == "5_18") {
    ?>
            <a href="javascript:void();"><img src="images/Navigation_Forward_Up.gif" border="0" name="Forward" onMouseOver="document.Forward.src=ForwardOver.src" onMouseOut="document.Forward.src=ForwardUp.src" onClick="checkAcceptance(i_agree);"></a>
    <?php         
            } else { ?>

       <a href="<?php print $_SERVER['PHP_SELF']; ?>?pg=<?php print $next_pg; ?>"><img src="images/Navigation_Forward_Up.gif" border="0" name="Forward" onMouseOver="document.Forward.src=ForwardOver.src" onMouseOut="document.Forward.src=ForwardUp.src"></a>

    <?php     
            }
        } //  if ($enable_next_button == "yes") {
    ?>
    </td>

#################################################################################

 

Any help is appreciated. Thank you.

Link to comment
Share on other sites

Php is on the server side and can only send data to the client. If you want to delay output or make anything after the page has been loaded javascript is the language to use. It runs on the client side and can manipulate the page after loading

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...