I assume that since you have an onclick attribute you are using LS version 2.0.
So, to modify the "Previous" button to go back 2 steps...
1) Enable the "Show question index / allow jumping" option in survey settings
2) Add this to template.js to hide all of the index stuff (this could also be done with CSS):
Code:
$(document).ready(function(){
// Hide the index stuff
$('#index').hide();
$('.withindex').removeClass('withindex');
});
3) Add this to the question source where you want the "Previous" behaviour modified:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// Remove the onclick from the "previous" button and bind a new click event
$("#moveprevbtn").attr('onclick', '').click(function () {
document.limesurvey.move.value = $('#thisstep').attr('value') - 2;
$('#limesurvey').submit();
});
});
</script>
Or, perhaps a more user-friendly approach would be instead of messing with the "Previous" button, simply add a new button to the question that takes them back 2 steps. Follow steps 1 and 2 above and then add something like this to the question source:
Code:
<p>
<button id="back2Steps" type="button">Back 2 Steps</button>
</p>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("#back2Steps").click(function () {
document.limesurvey.move.value = $('#thisstep').attr('value') - 2;
$('#limesurvey').submit();
});
});
</script>
.