Text entry - form: adding unique static text following text entry box | XM Community
Solved

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

  • 9 January 2019
  • 2 replies
  • 241 views

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'});
}
});
icon

Best answer by Anonymous 9 January 2019, 19:08

View original

2 replies

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'});
Hi Shashi,

Thank you very much!

Emily

Leave a Reply