Date - valid form drop-down menu
Posted: Sun Nov 01, 2009 4:54 am
Hello all,
I'm looking into making an XHTML form that will allow for electronic reservations in a club in my area. What I want to do is constrain the amount of days shown in the "day" drop down menu depending on the value selected in the "month" drop down menu. For example, If the user selects "November" as their preferred month, then "31" should not appear as a valid option in the "day" drop down menu. If I were to pick a different route, then I would just provide 31 days for all months.Then I'd check, with the aid of PHP, if specific months were given (for example, if($_POST["month"] = "February")) and then, if the user supplied a day greater than the 28th (February on non-leap years has 28 days), I'd print a warning message saying that the reservation will take place for the 28th of February, are you sure you want to continue, etc. However, this is not a very professional approach, and I wouldn't want to go down that path.
What would I need to do to achieve this effect? I think I might need Javascript, therefore rendering my posting of this enquiry on this subforum a bad idea. Please forgive me if this is the case.
Thank you.
I'm looking into making an XHTML form that will allow for electronic reservations in a club in my area. What I want to do is constrain the amount of days shown in the "day" drop down menu depending on the value selected in the "month" drop down menu. For example, If the user selects "November" as their preferred month, then "31" should not appear as a valid option in the "day" drop down menu. If I were to pick a different route, then I would just provide 31 days for all months.Then I'd check, with the aid of PHP, if specific months were given (for example, if($_POST["month"] = "February")) and then, if the user supplied a day greater than the 28th (February on non-leap years has 28 days), I'd print a warning message saying that the reservation will take place for the 28th of February, are you sure you want to continue, etc. However, this is not a very professional approach, and I wouldn't want to go down that path.
What would I need to do to achieve this effect? I think I might need Javascript, therefore rendering my posting of this enquiry on this subforum a bad idea. Please forgive me if this is the case.
Thank you.