Trying to display "MM/DD/YYYY" in answering textbox | XM Community
Solved

Trying to display "MM/DD/YYYY" in answering textbox

  • 10 November 2018
  • 4 replies
  • 45 views

Hello all,

I am trying to have the answering textbox display "MM/DD/YYYY" so as to prompt respondents about the expected date format. How can I do that?
icon

Best answer by NiC 10 November 2018, 19:06

View original

4 replies

Userlevel 7
Badge +27
You can put add this code in onload function :
`document.getElementById("QR~"+ this.questionId).placeholder = "MM/DD/YYYY" ;`
Badge

Hi, I need to do the same. I added this code and it isn't working. Is it possible that the Javascript code is now outdated?
Added here...
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
document.getElementById("QR~"+ this.questionId).placeholder = "MM/DD/YYYY" ;
});

Userlevel 7
Badge +27

Hi mattcrist ,
The code seems to be working fine. I tried it today on a text entry question and it is coming up correctly
image.pnghere is the preview link of the survey : https://paneledgesandbox.ca1.qualtrics.com/jfe/preview/SV_6QqetJgVGx9rd5k?Q_CHL=preview&Q_SurveyVersionID=current

Badge

Hi @NiC,
Thanks for your response. I was trying on a Form Field question type, and it doesn't appear to work on this question type. Once I switched to Text Entry, it worked just fine.
Best,
Matt

Leave a Reply