Flatpickr not saving data with Simple Layout | XM Community
Skip to main content
Solved

Flatpickr not saving data with Simple Layout

  • November 22, 2023
  • 5 replies
  • 186 views

Radam
Level 4 ●●●●
Forum|alt.badge.img+33
  • Level 4 ●●●●
  • 171 replies

I can get it to display using:

Qualtrics.SurveyEngine.addOnload(function()
{
jQuery("#question-"+this.questionId+" .text-input").flatpickr({
    dateFormat: "Y-m-d"
});

});

 

But upon answering the new question the date question’s data is deleted? See GIF below.

 

 

Best answer by qualtrics_nerd

Hi @Radam ,

You can check work around provide by @Tom_1842  on below link for simple layout.

 

While in the meantime , I am trying to find if there is a  workaround  without using embedded data.

Hope it resolves your query😊!!

5 replies

Radam
Level 4 ●●●●
Forum|alt.badge.img+33
  • Author
  • Level 4 ●●●●
  • 171 replies
  • November 27, 2023

Bumping this up hoping that it was lost in the holiday weekend.  Thank you!


Radam
Level 4 ●●●●
Forum|alt.badge.img+33
  • Author
  • Level 4 ●●●●
  • 171 replies
  • December 22, 2023

Sorry desperately bumping this back up for any guidance 


qualtrics_nerd
Level 5 ●●●●●
Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • 227 replies
  • December 22, 2023

Hi @Radam ,

I tried your code in my survey and it didn't work  (maybe you are using different layout).
If not can you try below code and update as below .
I have two Text entry question on a page , first one is  flatpicker and other one is  normal text entry.
The below JS code works perfectly for it , can you try and let me know:

 

Qualtrics.SurveyEngine.addOnload(function()
{

jQuery(".InputText").eq(0).flatpickr({
dateFormat: "Y-m-d"
});


});

Qualtrics.SurveyEngine.addOnReady(function()
{

});

Qualtrics.SurveyEngine.addOnUnload(function()
{

});


 



Hope it resolves your query😊!!


Radam
Level 4 ●●●●
Forum|alt.badge.img+33
  • Author
  • Level 4 ●●●●
  • 171 replies
  • December 22, 2023

I still doesn’t work for me in the Simple Layout, thank you for the help though! 


qualtrics_nerd
Level 5 ●●●●●
Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • 227 replies
  • Answer
  • December 22, 2023

Hi @Radam ,

You can check work around provide by @Tom_1842  on below link for simple layout.

 

While in the meantime , I am trying to find if there is a  workaround  without using embedded data.

Hope it resolves your query😊!!