Is there a way to add placeholder text to text entry questions? | XM Community
Skip to main content
Is there a way to add placeholder text to text entry questions?
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!
> @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!
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.
Perfect, thank you!
Is there a way to make the default responses read-only?
> @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);`
Fabulous! Thank you!
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.
@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