Dynamic Date Dropdown
- Current Version: 2.0
- Last Revision: 02.25.04
- Language: Javascript
This simple javascript method allows you to dynamically create a drop down box, or select element as they are often called, with dates going back as far as you need them to from the current date. All you need to do is pass the number of days you'd like the select to go back -- in this case seven days -- and add a div element with an id of mContainer that the function will set the innerHTML of. The option object values are formatted as YYYYMD.
Update: The method now takes a boolean argument, "direction", to specify whether the method should count forward (0) or backwards (1) from the current date.