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

How to retrieve element ID's inside a question

  • 8 August 2018
  • 4 replies
  • 548 views

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).
icon

Best answer by Anonymous 8 August 2018, 23:35

View original

4 replies

Userlevel 6
Badge +21
hey @welork ,
Preview your survey and inspect the input field in page.
Below image will help you:

!
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.
Userlevel 6
Badge +21
> @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');`

Thank you very much. It worked.

Leave a Reply