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();
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.