Datepicker date in multipage forms not sticking


(Joy) #1

Matrix Version: 5.3.4

I have a multipage form and have used Jquery UI Datepicker for the dates. I have used the Datetime field that is displayed as a text box.

However when I go to the next page and then go back, the field resets itself/is blank. On the confirmation page, the fileds using the datepicker is blank too.

How do I make the field value stick? Should I be using a text field instead?


(Bart Banda) #2

Are you saying that all fields are blank when you go back? Or just the datetime field that you are using jQuery on?

Do you have a public version of this form we could check out?

Have you tried using the form without using any JS to see if the values are sticking?

Also, make sure that caching is turned off on the form.


(Joy) #3

It is only the fields that are using the datepicker that is blank. I originally created the multipage form with the normal date fields and they were working fine. It is only when I added the datepicker that the date value didn’t stick.


(Bart Banda) #4

That sounds like it’s the jQuery UI then that’s doing something with it and clearing it. If you disable jQuery UI and any other custom JS, does it work then?


(Peter McLeod) #5

Hi

Might be an issue with the date formats - eg a difference between the value that is getting stored/persisted accross page loads in the input element and what the datepicker requires when it gets initialized.

When you inspect the input element - what’s its value set to? and also what is the ‘dateFormat’ set to (if anything) in your datepick setup code?

Thanks
Peter


(Joy) #6

Hi Peter,

You are correct, it was the date formats, I have now made the date formats the same in Datepicker and in the Matrix field and it is working now. Thanks for your assistance

Cheers
Joy


(Joy) #7

So I spoke too early, the datepicker dates do not stick when I go to the next page and go back. The normal Squiz date fields work fine.

Has anyone had this issue before?