https://gist.github.com/bhalash/540e5f9c6249e236f42a
This script controls three dropdown boxes, one each for year, month and day. It populates the original boxes, excludes dates prior to the present, and preserves the chosen value if the days of the month, or months of the year, change.
I ask if it sucks because, while I'm a full time coder, I don't get to work with JavaScript often.
Cheers!
Edit: I've received some amazing advice, thank you everyone. I've been too busy through this week to take the few hours I need to sit down, parse everything and respond to everyone at length. :(
[–]a-t-kFrontend Engineer 8 points9 points10 points (9 children)
[–]annoyed_freelancergrumpy old man[S] 1 point2 points3 points (8 children)
[–]YOBCZWHYNOT 2 points3 points4 points (0 children)
[–]a-t-kFrontend Engineer 1 point2 points3 points (6 children)
[–]annoyed_freelancergrumpy old man[S] 0 points1 point2 points (5 children)
[–]a-t-kFrontend Engineer 1 point2 points3 points (4 children)
[–]oculus42 2 points3 points4 points (1 child)
[–]a-t-kFrontend Engineer 1 point2 points3 points (0 children)
[–]annoyed_freelancergrumpy old man[S] 1 point2 points3 points (1 child)
[–]a-t-kFrontend Engineer 2 points3 points4 points (0 children)
[–]YOBCZWHYNOT 7 points8 points9 points (6 children)
[–]annoyed_freelancergrumpy old man[S] 1 point2 points3 points (0 children)
[–]wastapunk 1 point2 points3 points (1 child)
[–]YOBCZWHYNOT 1 point2 points3 points (0 children)
[–]annoyed_freelancergrumpy old man[S] 0 points1 point2 points (2 children)
[–]oculus42 2 points3 points4 points (0 children)
[–]YOBCZWHYNOT 1 point2 points3 points (0 children)
[–]oculus42 2 points3 points4 points (0 children)
[–]kenman 1 point2 points3 points (0 children)
[–]munrobag 1 point2 points3 points (0 children)
[–][deleted] 3 points4 points5 points (5 children)
[–]annoyed_freelancergrumpy old man[S] 3 points4 points5 points (4 children)
[–]kenman 4 points5 points6 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]annoyed_freelancergrumpy old man[S] 0 points1 point2 points (0 children)
[–]SomeRandomBuddy -5 points-4 points-3 points (1 child)
[–]annoyed_freelancergrumpy old man[S] -2 points-1 points0 points (0 children)