Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Delay navigation button

How can I delay the "next question" button for some seconds to make sure people read the text properly?

SSI7
asked Nov 7, 2011 by anonymous
retagged Sep 1, 2016 by Walter Williams

2 Answers

+2 votes
 
Best answer
Download the zip file on the main site for delayed submit buttons, but the code included doesn't run on SSI7, the "submitbtn" in the code needs to be changed to "sys_next_button" and you have to use text based next buttons

<script type="text/javascript">

function disableNext ( )
{
  originalValue = document.mainform.sys_next_button.value;
  document.mainform.sys_next_button.disabled = true;
  document.mainform.sys_next_button.value = "Please wait...";
  setTimeout ( "countDown()", 1000 );
}

function countDown() {
    document.mainform.sys_next_button.value = "Please wait...";
    if(timeOutRemaining > 0) {
              timeOutRemaining--;
              setTimeout("countDown();", 1000);
        } else {
              enableNextButton();
        }
}

function enableNextButton ()
{
  document.mainform.sys_next_button.disabled = false;
  document.mainform.sys_next_button.value = originalValue;
  
}

window.onload = disableNext;
var originalValue;
var timeOutRemaining = 154; //3 Seconds
  
  
</script>
answered Nov 8, 2011 by anonymous
edited Nov 8, 2011 by Walter Williams
+2 votes
this here is a small script that shows Next only when the movie stops playing.
                                                                     
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
  <td> 
    <object id="MediaPlayer" width=800 height=600 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
<param name="filename" value="[%GraphicsPath()%]Film.wmv">
<param name="Showcontrols" value="false">
<param name="enableContextMenu" value="false">
<param name="SendPlayStateChangeEvents" value="True">
<param name="PlayCount" value="1">
<param name="autoStart" value="True">

</object></td>
</tr>
</table></center>
<SCRIPT LANGUAGE="JScript"  FOR="MediaPlayer" EVENT="playStateChange(NewState)">


if (NewState == 0) 
{ 
    document.getElementById("submit_button").style.display = 'block'; 
}
</SCRIPT>


In your case, you'd want to set the submit button to hidden on page load and start a javascript timer to set it back to block (visible) after a given time.
answered Nov 7, 2011 by Bahadir Ozkurt Gold (16,830 points)
edited Nov 7, 2011 by Bahadir Ozkurt
...