Date of Birth Field


#1

There should be a date of birth selector that makes it easier to pick the year.


#2

Hello Trent,

This is actually quite an easy fix.

Follow the guide here: [How to] Add a Calendar Date Picker To Your Form

BUT, when you get to this part skip it:

<//script>
(function() { ( “#start_date” ).datepicker();
});
</script//>

And use this instead: (Remove the // I made inside the script tags)

<//script>
(function() { ( “#start_date” ).datepicker({
yearRange: “1900:2018”,
changeMonth: true,
changeYear: true
});
});
</script//>

Best regards
Andreas Obel


#3

This sounds like just the solution I need! But after switching out these scripts it doesn’t seem to work for me! Any ideas? Here is the page I’m using it on: https://digital.gwinnettmedicalcenter.org/robotic-gyn/
Here is the screenshot of my script:

Thanks so much!
Tiffany


#4

I think the script that was posted above is missing the “$” symbols and also, the quotation marks in your version are not the same (that’s why it’s grayed out in parts). I’m not JavaScript expert, but I played around with it, and this modified version is working for me:

<script>
  $(function () {
        $("#date_of_birth").datepicker({
            changeMonth: true,
            changeYear: true,
            yearRange: '1900:2018'
        });
    });
</script>

#5

Thank you! That worked perfectly!
Great help!
TIffany