Hello,
I see two problems on my website.
- First is with the front editing post. On this post : lien caché
We can see the field "Loyer TTC" empty however if we go to the admin we can see it is fill. lien caché
- Second, is an error after submitting a post. the field is not recorded.
Example : lien caché
On the form, we can see the field "Date de Livraison" fill, but when we submit it is not recorded.
I hope you can help me.
Hi, I'm seeing several errors on your site related to SSL issues and Cloudflare. This looks like something you need to resolve with your hosting company before we can continue to troubleshoot problems with custom fields and Forms. Please let me know if you need additional information from me to facilitate that conversation.
I think the problem with my host was just one or two minutes, you can see the website works right now and i have again the problems with CRED.
We can see the field "Loyer TTC" empty however if we go to the admin we can see it is fill.
I can't see the Loyer TTC field anywhere in the post editor because it's hidden. I'm attaching a screenshot of what I see (lot.jpg), and the Loyer TTC field is not visible. In the DOM inspector I can see the field but it has no value. If you edit the Loyer TTC custom field you can see why the field is hidden. There is custom conditional display logic in "data-dependent display filters" based on the $(dispositif) value:
($(dispositif) eq 'Pinel neuf') OR ($(dispositif) eq 'Résidence principale') OR ($(dispositif) eq 'Résidence principale zone ANRU')
However, there is no "dispositif" custom field, so the custom field will not appear in the Lot editor. There is a taxonomy "dispositif", but no custom field. Custom field conditional display in the post editor screen is only configurable based on other custom fields, not taxonomy terms. So $(dispositif) doesn't work in this context, and the field will not appear. Please refer to the documentation about conditional field display:
https://toolset.com/documentation/user-guides/types-custom-fields-conditional-display/
On the form, we can see the field "Date de Livraison" fill, but when we submit it is not recorded.
The problem is how the field value is set, with JavaScript:
var date_de_livraison = $("#ajout_auto_date-de-livraison").text()
$("input[name*='wpcf-date-de-livraison']").val(date_de_livraison);
Setting a complex field like a datepicker with JavaScript isn't recommended. The recommended method to set the value for a date field is a shortcode that returns the correct Unix timestamp, used in the "value" attribute of the field. The Types field shortcode can return a raw Unix timestamp like this:
[types field="date-de-livraison" output="raw"][/types]
You can put that raw timestamp in the "value" attribute of the cred field, like this:
[cred_field field='date-de-livraison' post='lot' value='[types field="date-de-livraison" output="raw"][/types]' class='form-control' output='bootstrap']
My issue is resolved now. Thank you!