Ok, I had some time on my hand, so here's a modified script that displays the calendar for the current month all the way up to the next 6 months of the next year:
Code:
<form>
<select onChange="updatecalendar(this.options)">
<script type="text/javascript">
var themonths=['January','February','March','April','May','June',
'July','August','September','October','November','December']
var todaydate=new Date()
var curmonth=i=todaydate.getMonth()+1 //get current month (1-12)
var curyear=todaydate.getFullYear() //get current year
var nextyear=curyear+1
function updatecalendar(theselection, theyear){
var themonth=parseInt(theselection[theselection.selectedIndex].value)+1
var theyear=theselection[theselection.selectedIndex].getAttribute("year")
var calendarstr=buildCal(themonth, theyear, "main", "month", "daysofweek", "days", 0)
if (document.getElementById)
document.getElementById("calendarspace").innerHTML=calendarstr
}
document.write('<option value="'+(curmonth-1)+'" year="'+curyear+'" selected="yes">Current Month</option>')
while (i<12){
document.write('<option value="'+i+'" year="'+curyear+'">'+themonths[i]+' '+curyear+'</option>')
i++
}
var x=0
while (x<6){
document.write('<option value="'+x+'" year="'+nextyear+'">'+themonths[x]+' '+nextyear+'</option>')
x++
}
</script>
</select>
<div id="calendarspace">
<script>
//write out current month's calendar to start
document.write(buildCal(curmonth, curyear, "main", "month", "daysofweek", "days", 0))
</script>
</div>
</form>
Simply use the above instead of the current form code you have for the calendar, and it should work.
Bookmarks