BuddyBoss Home – Web Support Forums Solutions Social Learner Registration Birthday Picker – Minimum Age requirement

Viewing 3 posts - 1 through 3 (of 3 total)
  • Question

    #62648
    @mln83

    Hi guys,

    I am using BuddyPress Xprofile Custom Fields Type to add a Birthday Picker.

    For my Social Learner site, users must be at least 13 years old as required by law. Is there a way to deny access to users if they enter a birthday that leads to an age younger than 13?

    Actually, the complexity goes beyond this requirement in Europe. In Spain for instance, people must be 14+ to sign up for a social network. For the most part, however, the age requirement is still 13+ like in the US.

    Best regards,
    Michael

    Answers

    #62649
    @mln83

    I think it can be done using JS:
    https://wordpress.org/support/topic/minimum-birthdate-age?replies=6

    I will try to follow the guide but please feel free to add suggestions if you have experience in this matter.

    Best regards,
    Michael

    #62650
    @mln83

    The JS code works:

    $('select#field_601_year option').each(function(){
     var legit_year = GetTodayYear() - 13;
     var current = $(this);
     if ( current.val() > legit_year ) {
      current.remove();
     }
    });
    
    function GetTodayYear() {
     var tdate = new Date();
     var yyyy = tdate.getFullYear();
     return yyyy;
    }

    However it doesn't filter for month/day – probably too advanced. I was wondering if it would be possible to calculate the age after they click “Complete Sign Up”?

    If calculated Age < X => throw a warning message (for instance require users to “Contact Us” directly).

    That would be awesome but for now, this will do.

    Best regards,
    Michael

Viewing 3 posts - 1 through 3 (of 3 total)
  • The question ‘Registration Birthday Picker – Minimum Age requirement’ is closed to new replies.