Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Change format Datepicker


I have implemented a jquery datepicker in a free format question. I want to display a date format different that the data saved.

date display : dd/mm/yyyy
and date saved : yyyy-mm-dd.

See my code :


<input type="text" class=PS4_date>
 <input type="hidden" name=PS4_date >

<script type="text/javascript">

$(function() {
      var alt=$(this).next();
           minDate: "01/01/1900",
          maxDate: "0",
                  dateFormat: "dd/mm/yy",
                 altFormat: "yy-mm-dd",

The result is good. The date display is well : dd/mm/yy and the date saved is well in the format yyyy-mm-dd when I click on next page, but when I came back I can not recover the date saved .

Do you have a solution ? Or it's possible and easier with your calendar sawtooth ?
asked Dec 2, 2019 by Virginie

1 Answer

0 votes
You will need to have two free format variables.  Then the HTML needs to look like this:

<input name="[% QuestionName() %]_date1" id="[% QuestionName() %]_date1" type="text" value=""/>
<input name="[% QuestionName() %]_date2" id="[% QuestionName() %]_date2" type="hidden" value=""/>

where "date1" and "date2" are the names of the variables.
answered Dec 2, 2019 by Zachary Platinum Sawtooth Software, Inc. (147,200 points)