Computing.Net > Forums > Web Development > dynamic drop down list

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

dynamic drop down list

Reply to Message Icon

Name: gloit
Date: March 18, 2004 at 19:05:05 Pacific
OS: winxp pro
CPU/Ram: 1gig/256mb
Comment:

I need to have a user select a date. The date has to be a specific format so the only way I can figure to do that is have a drop down list for month, day and year. How would I make it so if the user picks Jan then the days has 31 but if they select Feb there will only be 28? Or if there is a better way to have someone enter date I am open to suggestions. Needs to be in ASP, JavaScript or VBScript.

Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: safeTsurfa
Date: March 19, 2004 at 06:48:41 Pacific
Reply:

Each element of the date should be separated, so they each return a VALUE. Then get the user to choose Month first, which the Days element uses in an IF statement to offer the appropriate number of days depending on what value was returned by Month.

The only problem you will still have is the 28/29 February change for leap years. For this you can hard code a selection of years in another IF statement, namely, that if Month is February AND Year is 1992, 1996, 2000, 2004 (or whatever) offer 29, ELSE offer 28.

This will work best if you get the user to input YEAR first, then MONTH, so there are two values returned which DAY can look at.



0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: dynamic drop down list

'active' drop-down lists www.computing.net/answers/webdevel/active-dropdown-lists/2861.html

drop down menu database link www.computing.net/answers/webdevel/drop-down-menu-database-link/1447.html

Drop Down Box www.computing.net/answers/webdevel/drop-down-box/2882.html