How to Create Date of Birth picker with 18+ validation

I am trying to create a Sign Up form where one of the input fields needs to be Date of Birth. This is to validate and ensure the user is above 18 years old from today’s date.

I’m currently thinking of using the default date picker in Bubble. However, unsure how to set the validation to ensure that user is unable to pick a date they will be under 18 years.

I don’t know if Date Picker is the best option but happy to take on board any recommendations with some instructions on how to do it. I tried searching on the Forum as well as the wider internet and couldn’t find a definite answer.

Hi there, @KirayaUK… if I understand your post correctly, you should be good to go if you set the Maximum date for the date picker to Current date/time +(years): -18. Oh, and you probably want to check the box for Display dropdowns to pick month/year, too.

Hope this helps.

Best…
Mike

Edit: changed Minimum date to Maximum date for clarity and correctness.

1 Like

@mikeloc thank you so much for the prompt response. Really appreciate it. It worked like a dream. The only change I made was to put formula in the Maximum date instead of Minimum section so that anything after 14 June 2005 is greyed out.

My first post on here after only just starting on Bubble. Feels like the forum community is nice and strong. Can’t wait to continue engaging on here as I’m sure I’ll have many more queries in future :slight_smile:

1 Like

Oh, right… maximum date… my bad. When you’re as old as I am, dates and years can be quite confusing. :slight_smile:

1 Like