Skip to content

Instantly share code, notes, and snippets.

@13bzhang
Created April 8, 2016 01:51
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save 13bzhang/92be517b6558132c78620ad029c77f4d to your computer and use it in GitHub Desktop.
Qualtrics text before and after textbox
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place Your Javascript Below This Line*/
var inputs = $(this.getQuestionContainer()).select('input[type="text"]');
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
$(input).insert({before: 'In '});
$(input).insert({after: ' years'});
}
});
@13bzhang
Copy link
Author

13bzhang commented Apr 8, 2016

I added "In " before the textbox and " years" after the textbox. Just like this:

In [textbox] years

@ian-a-b
Copy link

ian-a-b commented Jun 8, 2017

Thank you for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment