Add my piped text to a Javascript code | XM Community
Question

Add my piped text to a Javascript code


Hi,
I've added the following Javascript to add 5 days to today's date and write that to a descriptive text box.
Qualtrics.SurveyEngine.addOnload(function()
{ Date.prototype.addDays = function(days) {
var date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
  return date;
}
var date = new Date();
var answer=date.addDays(6) ;document.getElementById('output').innerHTML = answer
;});

How can I switch our the "this" to the text entry date of my previous question please?

Thanks!


0 replies

Be the first to reply!

Leave a Reply