Navigation überspringen

[Gelöst] When a add a child i fill this field and i just see it was empty on all children

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

On a form which add child Custom Type. I fill Date Field with Jquery, it works on front, i see the field that is filled. But when we submit it doesn't save the date.

Solution:

It is a custom JS codes problem, see the solution here:

https://toolset.com/forums/topic/when-a-add-a-child-i-fill-this-field-and-i-just-see-it-was-empty-on-all-children/#post-1245740

Relevant Documentation:

https://toolset.com/documentation/customizing-sites-using-php/functions/#date

This support ticket is created vor 5 Jahren, 9 Monaten. 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Franck vor 5 Jahren, 9 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#1245739

Hi,

On a form which add child Custom Type. I fill Date Field with Jquery, it works on front, i see the field that is filled. But when we submit it doesn't save the date.

versteckter Link

Here we can see the date 31 décembre 2021 because the parent have this date.

#1245740

Thanks for the details, the custom date field of Types plugin stores value in timestamp format, I have done below modifications in your website:
1) Edit the form "Ajout lot"
versteckter Link
in section "Form editor", change line 350 from:

<p id="ajout_auto_date-de-livraison" style="display:none;">[types field="date-de-livraison" style="text" format="j F Y" item='[efx_getparam funcparam="parent_immobilier-neuf_id"]'][/types]</p>

To:

<p id="ajout_auto_date-de-livraison" style="display:none;">[types field="date-de-livraison" style="text" format="j F Y" item='[efx_getparam funcparam="parent_immobilier-neuf_id"]'][/types]</p>
<p id="ajout_auto_date-de-livraison-ts" style="display:none;">[types field="date-de-livraison" style="text" format="U" item='[efx_getparam funcparam="parent_immobilier-neuf_id"]'][/types]</p>

The second one will output the custom date field into timestamp format
https://toolset.com/documentation/customizing-sites-using-php/functions/#date

2) In section "JS editor", change line 9~10, to below:

  var date_de_livraison = $("#ajout_auto_date-de-livraison").text();
  $("input[name='wpcf-date-de-livraison[display-only]']").val(date_de_livraison);
  var date_de_livraison_ts = $("#ajout_auto_date-de-livraison-ts").text();
  $("input[name='wpcf-date-de-livraison[datepicker]']").val(date_de_livraison_ts);

Please test again, check if it is fixed or not, thanks

#1245769

My issue is resolved now. Thank you!