Have an idea?

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

Hide Radio button

Hi,

I have a single select question (Q3A), need to hide certain responses based on the previous question (Q2A - multi select) responses. I know something but it was for multi select question (Please refer below). Please help me to hide single select option.

<script>
 if ([%Q2A_r1_c1%] == 0)
 {
 document.getElementById("Q3A_r1_c1_graphical").visibility = 'hidden';
 document.getElementById("Q3A_r1_c1_graphical").disabled = 'true';
 document.getElementById("Q3A_r1_c1_graphical").className = 'HideElement';
 }
 </script>


Also I can't use AIC function since it is a grid question with 2 columns

https://www.sawtoothsoftware.com/forum/4876/constructed-list-for-grid-question
related to an answer for: Constructed list for grid question
asked Nov 21, 2013 by Abdul Bronze (2,630 points)
edited Nov 21, 2013 by Abdul

1 Answer

+4 votes
 
Best answer
Hi your single select variable name would be differ in this case. You need to change varibable name like Q3A_c1_1_graphical, if this is column wise.
<script type="text/javascript">

 if ([%Q2A_r1_c1%] == 0)
 {
 document.getElementById("Q3A_c1_1_graphical").visibility = 'hidden';
 document.getElementById("Q3A_c1_1_graphical").disabled = 'true';
 document.getElementById("Q3A_c1_1_graphical").className = 'HideElement';
 }
 </script>


If this is not a perfect solution, I need more clarity on single select question.
answered Nov 21, 2013 by Rajesh Rana Gold (24,770 points)
selected Nov 21, 2013 by Abdul
Thanks ranarajesh, but it is not working.

Q3A
                  Column 1                            Column 2
Brand1   Q3A_c1=1                           Q3A_c2=1
Brand2   Q3A_c1=2                           Q3A_c2=2
Brand3   Q3A_c1=3                           Q3A_c2=3
Brand4   Q3A_c1=4                           Q3A_c2=4
Brand5   Q3A_c1=5                           Q3A_c2=5

I have taken this from print study file.
I have tried your code both in footer and in custom JavaScript however it is not working in both place.
I just checked with dummy file here and it is working. For this condition, Q2A_r1_c1 should not be select, right.
Hi ranarajesh,
I tried your code even without any condition  (please refer below) for testing purpose however it was also not working
<script>
 document.getElementById("Q3A_r1_c1_graphical").visibility = 'hidden';
 document.getElementById("Q3A_r1_c1_graphical").disabled = 'true';
 document.getElementById("Q3A_r1_c1_graphical").className = 'HideElement';
 </script>
where I have to paste this code, footer or custom JavaScript?
No no this is not mine code, it's your own old code.

Put mine below code to footer. And I assume this grid questions is column wise as it is showing in your print study.

<script>

 document.getElementById("Q3A_c1_1_graphical").visibility = 'hidden';
 document.getElementById("Q3A_c1_1_graphical").disabled = 'true';
 document.getElementById("Q3A_c1_1_graphical").className = 'HideElement';

 </script>

This will hide first element of first column.
It works, ranarajesh. Thank you so much to solve this problem.
...