From the image above. I want to Enable and Disable the other columns whether it is a TextEntry/Dropdown/RadioButton/Checkbox depends on my answer on the 1st column .
For this example using Drop Down List. If I choose "Yes" , other columns will enable but if I choose "No" they will disable.
I tried some JavaScript codes. See here below if you think there is some problem with my code.
Thank you!
Page 1 / 1
There are a number of problems with your code:
- It will only work on the first row
- You shouldn't hard code QIDs
- The selector used for the change handler is wrong -
'select:first'
would work for the first row, but see (1) above. - The if condition is wrong. The value is the id, not the text (i.e., "Yes").
if(this.value==1)
would probably work. - You should use
.prop()
to set readonly (e.g.,.prop("readonly",false);
)
https://community.qualtrics.com/XMcommunity/discussion/comment/51191#Comment_51191It works now but for the 1st row only. What change handler will I be using for the succeeding rows? Thank you
https://community.qualtrics.com/XMcommunity/discussion/comment/51198#Comment_51198Ideally, you would loop through the choice rows and adjust your code accordingly.
jQuery("#"+this.questionId+" tr.Choice").each(function(i) {
jQuery(this).find("select:first").change(function(){
...etc...
});
});
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.