Jump to content
  • 0

Check if user is 18


CapNcook

Question

2 answers to this question

Recommended Posts

  • 0

Hi,

One way I could think of is use combination of rules and calculation.

For calculated value you may use the following formula to check if user is already 18.

 

CASE 
  WHEN DATEDIFF(YEAR, [@field:DOB], GETDATE()) >= 18 THEN 1
  ELSE 0
END

If the user is already 18 it would return 1 else 0.


with this value we can now setup our rules.

image.png.e34edfbff5cdce531be524ca1b9e9e85.png

Section 2 would be the container of our error message " You must be 18 "

as for the calculated field displaying 1 and 0 value you can hide it using simple CSS by following this article: https://howto.caspio.com/tech-tips-and-articles/how-to-hide-fields-in-datapages/

Hope this helps!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...