How to retrieve element ID's inside a question | XM Community
Skip to main content
Solved

How to retrieve element ID's inside a question


I would like to disable the Entry text field for five seconds, but I cannot find out the field IDs (not QID - I know how to get that).

Best answer by Anonymous

Hello @welork , The id of the entry text field is "QR~"+this.questionId. For eg if question id is "QID4"(without quotes) then element id is "QR~QID4"(without quotes) If we have more than one entry text fields then the id will be "QR~"+this.questionId+"2" , where 2 is the second text input field.! In the above image field 2 (with line) has id circled in the image.
View original

4 replies

PraDeepKotian_XM
QPN Level 5 ●●●●●
Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • 228 replies
  • August 8, 2018
hey @welork , Preview your survey and inspect the input field in page. Below image will help you: !

  • 0 replies
  • Answer
  • August 8, 2018
Hello @welork , The id of the entry text field is "QR~"+this.questionId. For eg if question id is "QID4"(without quotes) then element id is "QR~QID4"(without quotes) If we have more than one entry text fields then the id will be "QR~"+this.questionId+"2" , where 2 is the second text input field.! In the above image field 2 (with line) has id circled in the image.

PraDeepKotian_XM
QPN Level 5 ●●●●●
Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • 228 replies
  • August 9, 2018
> @PradeepKotian said: > hey @welork , > Preview your survey and inspect the input field in page. > Below image will help you: > > ! > hi again @welork , I like to add one more option to select id for text question by using javascript. Below code will help you: `var qid = jQuery("#"+this.questionId+" input[type=text]").prop('id');`

  • 7 replies
  • June 19, 2020

Thank you very much. It worked.


Leave a Reply