Hi everyone,
I am working on a survey with a note page after every question. Now when F10 or the note button is pressed, the notes come up. After moving to another question and coming back, the notes are again hidden.
What I am trying to do is get the notes from Q1 for example to remain displayed after skipping back to Q1 from Q2 if there is anything written in them, but to stay hidden if they are empty.
<style>
#[% QuestionName() %]_div {display:none}
</style>
<script>
$(document).keydown(checkNote);
function checkNote(f){
f = f || window.event;
if (f.keyCode == '121' || f.keyCode == '35'){
f.preventDefault(f);
$("#[% QuestionName() %]_div").css('display', 'block');
}
}
var $input1;
$('#[% QuestionName() %]').focus(function() { $input1 = $(this);
});
$(document).keydown(checkNote);
function displaynote (d){
d = d || window.event;
if ($input1.val().length != 0) {
d.preventDefault(d);
$("#[% QuestionName() %]_div").css('display', 'block');
}
}
<script>
This is the code that I have been using to try to achieve that. However even when I don't use jquery inputs and have tried something simpler,
function displaynote(d){
d = d || window.event;
if ( SSI_GetValue("e7011mnote") == 1) {
d.preventDefault(d);
$("#[% QuestionName() %]_div").css('display', 'block');
}
}
such as SSI_GetValue just to test if the rest of the code is working, my notes page doesn't remain displayed after I go back to it.
I am wondering if the issue is with the way that SSI Sawtooth treats inputs, or rather if it is with another part of my code or with my preventDefault command.
If anybody had any advice about this, that would be very helpful.
Thanks!