Skip Navigation

[Resolved] Clearing out a Required Conditional Field?

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.

This topic contains 6 replies, has 2 voices.

Last updated by Jamal 1 month, 1 week ago.

Assigned support staff: Jamal.

Author
Posts
#1624615

Hello. I'm trying to clear a conditional date field, but it's not working. Please see this video for more info:
hidden link

As always, thank you!

#1624635

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

Even though there is a display logic for the "Pre-Bid Meeting Date" field based on the "Pre-Bid Meeting" field, there is no logic that will clear the value of "Pre-Bid Meeting Date" when "Pre-Bid Meeting" is "None".

I can see two ways to resolve this issue:
- Displaying "Pre-Bid Meeting Date" conditionally based on the value of "Pre-Bid Meeting" when its value is different than "None". But this will keep the date value on the database.
- Clearing the database value for "Pre-Bid Meeting Date" when "Pre-Bid Meeting" is "None". This will require a custom to hook into the WordPress "save_post" hook. Check the solution of the following thread, it tries to calculate the value of a custom field based on other fields, it is the same logic, except that you will save an empty value for "Pre-Bid Meeting Date" when the value of "Pre-Bid Meeting" is "None".
https://toolset.com/forums/topic/calculate-value-of-a-custom-field-based-on-other-custom-fields-values/

I hope this helps. Let me know if you have any questions.

#1624943

Hi Jamal. I'm not really a coder, so some of that goes over my head. I'm sorry.

However, shouldn't the "Clear" button clear out the date? That seems to be a bug with toolset. Can you get that fixed?

Thanks.

#1626027

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

I run a local test and I can't say it is a bug. For example, once you "Clear" the date and save, the date will be created. But if you clear it, then hide it with the condition(choosing "None" for the "Pre-Bid Meeting") and save, the date is not cleared.

So, I would not say it is a bug. Instead, it is a usability issue. So I escalated this ticket to our 2nd Tier for further evaluation and analysis.

I'll get back to you as soon as I get any feedback.

#1629555

Hi Jamal. After further testing, it appears that if you edit anything hidden behind conditional logic will not save IF you hide the conditional field before saving the post. Please fix. Thank you.

#1629977

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for sharing your findings. I escalated your reply as a note on our internal tracking tool. We'll get back to you as soon as possible.

#2168855

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello there! I am happy to tell you that this issue has been fixed in this week's update(Toolset Types 3.4.13). Our sincere apologies for the long time it took.

Please follow this article to automatically update the Toolset plugins. ** Make a full backup before updating the production site. **
https://toolset.com/faq/how-to-install-and-register-toolset/