Начало
Формы
Авто Месяц
Это меню со спуском автоматически приспособит диапазон месяцев так, чтобы текущий месяц был наверху.
JavaScript Forms: Авто Месяц
<!-- ONE STEP TO INSTALL AUTO MONTH: 1. Copy the coding into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the BODY of your HTML document --> <BODY> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- 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> <!-- Script Size: 1.74 KB -->