Text entry - form: adding unique static text following text entry box | XM Community
Skip to main content
Solved

Text entry - form: adding unique static text following text entry box


I would like to add static text following a form field indicating the units of measurement so one form for feet and one form for inches. I am able to add static text following one form field using the code below, however I am not sure how to add different text for the second form field. Is it possible to do this so that my form fields read [text entry] feet and [text entry inches] horizontally? Thank you for your help! { /*Place your JavaScript here to run when the page loads*/ var inputs = $(this.getQuestionContainer()).select('input[type="text"]'); for (var i = 0; i < inputs.length; i++) { var input = inputs[i]; $(input).insert({after: ' feet'}); } });

Best answer by Anonymous

Hello @ewolf103 , Use the below code var inputs = $(this.getQuestionContainer()).select('input[type="text"]'); var input = inputs[0]; $(input).insert({after: ' feet'}); var input = inputs[1]; $(input).insert({after: ' inches'});
View original

2 replies

  • 0 replies
  • Answer
  • January 9, 2019
Hello @ewolf103 , Use the below code var inputs = $(this.getQuestionContainer()).select('input[type="text"]'); var input = inputs[0]; $(input).insert({after: ' feet'}); var input = inputs[1]; $(input).insert({after: ' inches'});

  • Author
  • 1 reply
  • January 9, 2019
Hi Shashi, Thank you very much! Emily

Leave a Reply