Skip Navigation

[Resolved] Date field value not being recorded when post form is submitted

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by ericE-4 4 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1655193

I have embedded a post form on this pageL: hidden link

To reproduce this bug:
1. Fill out fields first name, last name, email, Your group size?, How many days of fishing do you want?, and the First choice date field.
2. Skip all other steps and on the last page of the wizard, click "SUBMIT"
—> The resulting new Form post that's created has all data that was input except the date field is blank.

#1655643

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

With the form you shared: hidden link

To reproduce this bug:
1. Fill out fields first name, last name, email, Your group size?, How many days of fishing do you want?, and the First choice date field.
2. Skip all other steps and on the last page of the wizard, click "SUBMIT"
==>
I tried to follow the above step and fill the form fields and when I click on "Next" button I can see the following JS on the browser's console and stuck on the same form step. I could not able to move to the next step.

Uncaught TypeError: Cannot read property 'call' of undefined
    at $.validator.check (autoptimize_single_388945297ddb72c9050260bc4f202fc8.js:37)
    at $.validator.checkForm (autoptimize_single_388945297ddb72c9050260bc4f202fc8.js:25)
    at $.validator.form (autoptimize_single_388945297ddb72c9050260bc4f202fc8.js:24)
    at n.fn.init.valid ((index):1733)
    at HTMLFormElement.onStepChanging ((index):6673)
    at HTMLFormElement.dispatch (jquery.js:3)
    at HTMLFormElement.r.handle (jquery.js:3)
    at Object.trigger (jquery.js:3)
    at n.fn.init.triggerHandler (jquery.js:3)
    at goToStep ((index):5034)

Just like the another ticket, when the page is loaded: hidden link
- I can see the followng JS error on browser console:

Uncaught SyntaxError: Invalid regular expression flags

Can you please try to delete cache or disable the cache plugin for a moment and check if the issue is when your third-party plugin minify the JS.

#1656513
Screen Shot 2020-06-09 at 8.23.30 PM.png

There is no JS error when I use the form , but I disabled the Autoptimize plugin anyway. Here is a video of filling out the form (the console is visible and you can see no JS errors occur): hidden link Also below is the post that was generated when the form was filled out in the video. As you can see, there's no date in the field that a date was selected for.

#1657079

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked on your install and now I can navigate through your form wizard.

Yes, I can see the date is not populated when you submit the form but when I check the date field value is not get posted when you submit the form.

I am not sure how you build the multi-step form as Toolset do not support multi-step form.

I see when I submit the form the selected date value is not get submitted with the form and that is why you see selected date is not get saved.

Date field value should be saved as timestamp.

If you agree, I can use the Toolset form hook: cred_save_data and try to save the date value as Unix timestamp. Do you agree?

#1657931

I had another bug regarding the lag that happens whenever a Toolset form uses the built-in datepicker control. The workaround employed for that has resolved this issue.