Currently, if the user clicks "next", it reloads the page (and replays the musical stimulus which they are supposed to hear only once). Can I stop it doing that?
I found something in the manual but I'm not sure if this is it. If yes, do I have to put it on every page or just the template for questionpage?
// Interrupt the submit function and validate mandatory questions
// NOTE: Comment this section out if questions are not mandatory
$('form#limesurvey').submit(function(){
// Override the built-in "disable navigation buttons" feature
$('#moveprevbtn, #movenextbtn, #movesubmitbtn').attr('disabled', '');
// Loop through all "shown" questions and check for answer
var answered = 0;
$.each(shownQuestions, function(i, val){
if ( $( 'div#' + val + ' input.radio:checked' ).length == 0 ) {
$( 'div#' + val + '' ).css('color', 'red');
answered = 1;
}
else {
$( 'div#' + val + '' ).css('color', '');
}
});
if ( answered == 1 ) {
alert ( mandatoryMsg );
return false;
}
else {
return true;
}
});