Hi, I'm trying to validate if a 'Statement' in the Matrix table question exists using jquery. So the 'Statement' is a span element. I added this 'span' element using the 'html' editor in the matrix table question. Here is the html for the 'Statement' -- ASM)
And here is my js code inside onready function,
if ($('#asm').length) {
alert("The element you're testing is present.");
alert($('#asm').text());
}
But I'm getting this error ---> Uncaught TypeError: Cannot read property 'length' of null. And I inspected the page and confirmed that the 'asm' id element exists so not sure why it is throwing a null.
And I tried this same code outside of Qualtrics using a html and it works perfectly fine. Just strange. Not sure what am i missing. Any help appreciated.
Matrix table question -- validating the statements
Best answer by Username_taken
Thank you ahmedA . Found out what the issue was -- it is the '$' sign that was causing the issue. Once I changed it to JQuery (instead of $) it worked. Thanks again.
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.
