Hello, I have form field question ; and for the email I sent out on submit I need to generate a string “label”+”value”. I can read the value of the input, but I can’t figure out how to read the ‘label”?

Hello, I have form field question ; and for the email I sent out on submit I need to generate a string “label”+”value”. I can read the value of the input, but I can’t figure out how to read the ‘label”?

Best answer by Tom_1842
I think you could do this by getting the inner text of the form fields based on their id, like in the below:
var qid = this.questionId;
var label1 = document.getElementById("QR~"+qid+"~1~label").innerText;
var label2 = document.getElementById("QR~"+qid+"~2~label").innerText;
var label3 = document.getElementById("QR~"+qid+"~3~label").innerText;You could also do it with jQuery based on the index of span.LabelWrapper label>span, like in the below:
var qid = this.questionId;
var label1 = jQuery("#"+qid+" span.LabelWrapper label>span").eq(0).text();
var label2 = jQuery("#"+qid+" span.LabelWrapper label>span").eq(1).text();
var label3 = jQuery("#"+qid+" span.LabelWrapper label>span").eq(2).text();
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
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.