I have two columns in a side-by-side question. Column 1 has options 1-4, the 4th of which is 'N/A'. Is there a simple way I could disable the second column if 'N/A' is selected in column 1?
Right now I have
jQuery("#"+this.questionId+" input[type='radio']").on('click',function(){
if(jQuery(this).val()==4){
jQuery("[id='QR~QID106#2~1']").prop("disabled", true);
jQuery("[id='QR~QID106#2~2']").prop("disabled", true);
jQuery("[id='QR~QID106#2~3']").prop("disabled", true);
}
});
but because I have three rows, the above disables the second column entirely if option 4 is selected for ANY of the three rows. How can I edit this so it only disables the row where N/A is selected in the first column?
How can I disable a dropdown list in a second column if N/A is selected in column 1?
Best answer by TomG
Don't use ids. Find the second column element relative to the first. For example, if the second column is a text input:
var col1 = jQuery(this);
if(col1.val()==4) col1.closest("tr").find(".InputText").prop("disabled",true);
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
