Have an idea?

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

Auto-submit Next button with v9.4.0

Hi,

We are used to use this Javascript to hide the "next buton" for a while but it seems to not run with the new version (9.4.0). Has anything changed in the code ? (for instance "_sys_next_button") ? Thanks a lot for your help!
asked Sep 5, 2017 by Thomas
What code are you using?  If you are using these:

$('#next_button').hide();
$('#next_button').show();


you shouldn't need "sys_next_button" anywhere.
I use this code:
<script type="text/javascript">
function disableNext ( )
{
  document.mainform.sys_next_button.disabled = true;
}
window.onload = disableNext;
</script>

<script type="text/javascript">
var link = document.getElementById("link1");
link.onclick = function enableNextButton ()
{
      $("div.submit_div").slideUp(00).delay(30000).fadeIn(1000);
      document.mainform.sys_next_button.disabled = false;
      $("#videotext").hide(0).delay(30000).show(0);
}
</script>

1 Answer

0 votes
 
Best answer
I don't think you need either of those "sys_next_button" parts.  The function disableNext just needs this content:

$('.submit_div').hide();


The function enableNext just needs this content:

$('.submit_div').show();
$("#videotext").show();
answered Sep 5, 2017 by Zachary Platinum Sawtooth Software, Inc. (86,925 points)
Hi all,
 
where would I need to replace the "old" code pasted at the bottom of my comment with these new code elements  you mentioned:
$('.submit_div').hide();
$('.submit_div').show();

in order to make it work again?

This is the old code:

<script type="text/javascript">

function disableNext ( )
{
  originalValue = $('.submit_div')
$('.submit_div').hide()
$('.submit_div').value = "Please wait (" + timeOutRemaining-- + " seconds)";
     setTimeout ( "countDown()", 1000 );
    }
}

function countDown() {
    $('.submit_div').value = "Please wait (" + timeOutRemaining-- + " seconds)";
    if(timeOutRemaining > 0) {
              timeOutRemaining--;
              setTimeout("countDown();", 1000);
        } else {
              enableNextButton();
        }
}

function enableNextButton ()
{
  $('.submit_div').show();
  
}

window.onload = disableNext;
var originalValue;
var timeOutRemaining = 15; //3 Seconds
  
  
</script>



I manage to hide the submit arrow but it doesn't show me a countdown and it also does not reappear again.

Thanks in advance for your help!
...