Have an idea?

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

help show question if button pressed

I am trying to add an open-ended question to the end of every page in order to add field notes. I want to hide the question unless the CAPI interviewer presses a button (ideally F10, but I know special buttons are more difficult to work with).

For example, I have b702 and b702note. I want b702note to stay hidden unless the user presses a specific key. I am trying to come up with the code to do such a thing. I have tried putting the code in the header of both questions, but I am sure my code is not correct. (for now I am trying to just use 1 and 2 to test, but need to change the keys to a specific key with no other function. Any help is appreciated!!!

#b702note_div {display:none}

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js">

<script type="text/javascript" input type="text"> 

        if(e.keyCode == 49 ){
        $("#b702note_div").css('display', 'none');}
        else if(e.keyCode == 50){
        $("#b702note_div").css('display', 'block');}             


sidenote, I am using $(document).keydown(checkKey); to use arrow keys to navigate... I know there is sometime a conflict with checking keys, but not sure how to handle that or how to use "addEventListener" to fix it...
asked Jan 30, 2015 by ab3886 (310 points)
retagged Jan 30, 2015 by Walter Williams
I would love to see this feature implemented in V9, not just for O/E questions but for any question type (select, grid, etc.). And the hidden question doesn't just appear due to hitting a button but also appears due to the way another shown question is answered (e.g. by selecting YES to the select question on the same page).

To solve your problem, you would need some fancy JavaScript.

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.