setting dynamic default values in a list/menu
To save problems with inserting dates into a Mysql database, I have split the input fields on the file insert form into three drop down lists containing the day, month and year.
In order to make it easy for users, I wish to take the current date, split it into day (dd) month (mm) and year (yyyy), and use one of these values as the default option for each of the three fields.
In html you would use :
<option value="2012" selected>2012</option> for the default, but this is a fixed default.
I want it to change depending on the actual year., so that if today is 21-02-2012, (thats how we use dates in the UK) the three fields default to 21 (dd) 02 (mm) 2012 (yyyy).
I can re-format them into MySql date format mmddyyyy no problem later to insert them into the database
Any ideas?
Or is there a better way to do this?
