Hi,
I want to hide certain cells in a series of constant sum matrix tables. I have looked at other threads posted on the community and I am using the below code to hide the cells that I don't want the respondent to answer -
Qualtrics.SurveyEngine.addOnload(function()
{
$('QR~QID10~1~4').up('td').childElements().invoke('hide');
$('QR~QID10~2~4').up('td').childElements().invoke('hide');
});
When I preview the question the cells are hidden as I planned but when I preview the full survey, the javascript doesn't appear to work. Looking at the developer console on Chrome I have a lot of errors on the page which I have attached.
error text.txtIs this an error with my code or something else? It is strange that it works when previewing the question but not during the full preview. Any help would be greatly appreciated.
Hide Specific Cells in a Matrix Constant Sum Question
Best answer by SurajK
You need to use the jQuery selector instead of $ and you will have to specify if it is class (using .) or id (using #).
Use the below code to hide the specific element in your question, just change the index number (eq) from the below code.
//First row second element
jQuery('tbody tr:eq(0)').find('td:eq(1)').find('input').css('display','none')
// Second row first element
jQuery('tbody tr:eq(1)').find('td:eq(0)').find('input').css('display','none')
// first row first element
jQuery('tbody tr:eq(0)').find('td:eq(0)').find('input').css('display','none')
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.
