Is there a way to add placeholder text to text entry questions? | XM Community
Skip to main content
Solved

Is there a way to add placeholder text to text entry questions?


Goldie
Qualtrics Employee
Forum|alt.badge.img
  • Qualtrics Employee
  • 34 replies
Is there a way to add placeholder text to text entry questions?

Best answer by lillianc

From the text entry question, click the gear icon to the left. There is an option to Add Default Choices. You can enter your default text in the text entry box and save. The default text will appear inside the text box.
View original

11 replies

RachelTHREE
Level 2 ●●
Forum|alt.badge.img+2
  • Level 2 ●●
  • 80 replies
  • November 14, 2017
Oh this is a really interesting question (If I'm understanding correctly, having a greyed out "Please tell us" or something like that in the blank prior to a participant filling it out?). I'd be really curious to know this too!

Goldie
Qualtrics Employee
Forum|alt.badge.img
  • Author
  • Qualtrics Employee
  • 34 replies
  • November 14, 2017
> @RachelTHREE said: > Oh this is a really interesting question (If I'm understanding correctly, having a greyed out "Please tell us" or something like that in the blank prior to a participant filling it out?). > > I'd be really curious to know this too! Yep, that's exactly what I'm wondering!

lillianc
Level 3 ●●●
Forum|alt.badge.img+7
  • Level 3 ●●●
  • 69 replies
  • Answer
  • November 14, 2017
From the text entry question, click the gear icon to the left. There is an option to Add Default Choices. You can enter your default text in the text entry box and save. The default text will appear inside the text box.

Goldie
Qualtrics Employee
Forum|alt.badge.img
  • Author
  • Qualtrics Employee
  • 34 replies
  • November 14, 2017
Perfect, thank you!

Christaann
Forum|alt.badge.img+1
Is there a way to make the default responses read-only?

  • 0 replies
  • October 22, 2018
> @Christaann said: > Is there a way to make the default responses read-only? Paste the following code in js(OnReady) `jQuery("#"+this.questionId+ " .InputText").attr("readonly",true);`

Christaann
Forum|alt.badge.img+1
Fabulous! Thank you!

Christaann
Forum|alt.badge.img+1
Does this work for multiple choice questions, too? For example, I want a response option in a multiple choice question to be selected and read only.

EllenW
Forum|alt.badge.img+2
  • 4 replies
  • October 23, 2019
@Goldie @RachelTHREE I found some javascript code in this thread that shows how to include placeholder text that disappears when the respondent starts typing!

Adding my take here, as it's the first result on Google, and there are lots of variable answers in the linked answers.
Placeholder text should disappear when the user starts typing, and won't be submitted as a value if it's left blank.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefplaceholder

  • Click the "cog" button to the left of the question needing placeholder text, then "Add Javascript…"

  • clear the default code, and paste the following code

  • update the
    PLACEHOLDER
    variable (in the example it's "
    dd/mm/yyyy
    ")

  • save

Qualtrics.SurveyEngine.addOnReady(function() {
var PLACEHOLDER = 'dd/mm/yyyy';
jQuery('#QR\\\\~' + this.questionId).attr('placeholder', PLACEHOLDER);
});
This works for
input
and
textarea
(short and long text questions), and will survive the question being dragged into a new order.


Note that the Default Text option selected as the answer to this question may result in the default text being recorded as an answer:

The Add Default Choices feature pre-selects an answer choice for your respondent. So if a respondent decides to skip this question, then your results will still display data as if the respondent had given an answer.

https://www.qualtrics.com/support/survey-platform/survey-module/question-options/add-default-choices/


Leave a Reply