Skip Navigation

[Resolved] Conditional viewing based on a minimum age of 18 / CRED form

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

This topic contains 4 replies, has 2 voices.

Last updated by klausB 2 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#2431705

Hi,
I'm trying to create a query in a CRED form from a date picker that will test if a user is 18 or not. We found the following topic:
https://toolset.com/forums/topic/form-advanced-conditional-display/
At first we thought this would be the right approach, but unfortunately it doesn't work with all dates.
For example, a date after 2000 will be misinterpreted. Does anyone have a solution for this problem?

Best regards

#2433437

Hello,

Thanks for the details, it is not a built-in feature of Toolset Forms plugin, I need to check if there is other better workaround, will update here if find anything

#2434069

I have tried the solution provided in the thread you mentioned above it works fine, you can see the result in the live demo website:
hidden link

Login URL:
hidden link

it is using the steps of solution in this thread:
https://toolset.com/forums/topic/form-advanced-conditional-display/

#2434451

Hi Luo,

thank you for your example it was very helpful. So now I was able to fix the error.
The problem was that the example code of the topic I mentioned looks different than yours on the test page.

Here's the difference:
sample = function tssupp_strtotime($atts = [])
your solution = function tssupp_strtotime($atts)

Now everything works fine.

Thank you very much again.

#2434455

My issue is resolved now.
Great Support! Many many thanks!