Originally Posted by glenngv
Why do you prompt for month name instead of just month number? Typing text is more error prone compared to numbers.
If you prompt for numeric birth month, then the date of birth could be easily created.
var dob = new Date(birthYear, birthMonth - 1, birthDay);
Of course, you have to validate the inputs to ensure the valid values are entered.
It would be alot easier if I could as for the month by number but I have to as for month in text and then convert to the number.
What I came up with was
var yearString = 'birthyear';
var monthNumber = '';
var dayString = 'birthDay';
//the date object is created like so:
var myBirthday = new Date(yearString, monthNumber, dayString);
//now a date object is contained in the variable called myBirthday
but not sure how to take the pos and put that into the monthNumber