View Full Version : actual date in a list menu ?
muchi_us
10-14-2002, 05:24 PM
I have a data list on my website (month, day, year). Whit the command "selected" this month or day comes up directly, but then I have to change the "selected" command every month. Is there a javascript, who puts the actual date in this list/menu ? (something like check out the date, filter the month and put this as "selected" in the options list ?). The website is http://www.lasvegasmap.info and it concerns the "Book a room" button, where you have to put in the booking date.
Thank you Markus
adios
10-14-2002, 06:44 PM
Well...personally, I blow with dates but, hey, I'll take a whack anyway:
<head>
<script type="text/javascript" language="javascript">
function setDate() {
var today = new Date();
with (document.Search_Hotels) {
StartMonth.selectedIndex = today.getMonth();
StartDay.selectedIndex = today.getDate() - 1;
var thisyear = today.getYear().toString();
StartYear.selectedIndex = thisyear.charAt(thisyear.length-1) - 2;
}
}
</script>
</head>
<body bgcolor="#FFFFFF" onload="setDate()">
muchi_us
10-14-2002, 06:53 PM
Adios thank you very much ! It works fine !
Markus:thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.