Skip Navigation

[Resolved] Split: custom date field not working on Edit post form

This thread is resolved. Here is a description of the problem and solution.

Problem:
Split: custom date field not working on Edit post form

Solution:
To override the custom date field options on Toolset post Edit form you need to add custom JS to Form's JS box:

You can find the proposed solution, in this case with the following reply:
https://toolset.com/forums/topic/split-custom-date-field-not-working-on-edit-post-form/#post-1218343

Relevant Documentation:

This support ticket is created 5 years, 10 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)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Amin 5 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1218341

Thanks for the quick response, Minesh. While the solution you provided works to add the date to the database, when I go back to edit the post (via cred edit form), the data is not being displayed.

You can replicate this by logging into the website and viewing any of the "sitters" posts from the front end. You'll see the cred edit form below the post details.

hidden link

The date is saved in the db and visible from the backend, but not on the frontend edit form.

Thanks in advance.

#1218343

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - I've added the following code to your Edit forms JS box:

jQuery(window).bind("cred_form_ready", function() {
  
              jQuery('input[name="wpcf-sitter-date[display-only]"').each(function() {
                  val = jQuery(this).val();
                  jQuery(this).datepicker("option", "minDate","-18y");
                  jQuery(this).datepicker("option", "maxDate", 0 );
                  jQuery(this).datepicker("option","yearRange","-18:+0");
                jQuery(this).val(val);
                  
             });

});

Can you confirm it works as expected?

#1219143

My issue is resolved now. Thank you!