Script Categories













Forms >>> Auto Month.

This pulldown menu will automatically adjust the range of months so that the current month is at the top. The remaining months are placed in order after the current month.

Add the below code to the <body> section of your page:

<center>
<script language="javascript" type="text/javascript">
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var time = new Date();
var month = time.getMonth();
var date = month - 12;
var realJavaScriptMonth = month;
var future = month + 0;
month = month + 1; /* Compensate for "January" being "0" */
document.writeln ("<FORM><SELECT><OPTION value=\"\">Month");
do {
month = date;
if (month >= 12) {
month = month - 12;
}
if (month < 0) {
month = month + 12;
}
date++;
var dateName ="";
switch (month) {
case 0:
dateName = "January";
break;
case 1:
dateName = "February";
break;
case 2:
dateName = "March";
break;
case 3:
dateName = "April";
break;
case 4:
dateName = "May";
break;
case 5:
dateName = "June";
break;
case 6:
dateName = "July";
break;
case 7:
dateName = "August";
break;
case 8:
dateName = "September";
break;
case 9:
dateName = "October";
break;
case 10:
dateName = "November";
break;
case 11:
dateName = "December";
break
}
month++;
realJavaScriptMonth++;
document.write ("<OPTION value=\"" + realJavaScriptMonth + "\">" + dateName + "");
realJavaScriptMonth++;
}
while (date < future)
document.write ("</SELECT></FORM>");
//  End -->
</script>
</center>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).




©