<select id="年" name="年"><option value=""></option></select>年
<select id="月" name="月"></select>月
<smlct="Day" name="Day"></mlectt<br />
<smlctt="iyear" name="i Year"><option value=""></option></select> 年
<select id="iMonth" name="iMonth"></select>月<select id="iDay" name="iDay"></select>日
<script language="javascript">
<!--
//使用方法(オブジェクト差異文字列、デフォルトの選択日、期間)、順序要件なし
PPDayselect("");
PPDayselect("i","1988-8-8","1988-1999");
function PPDayselect(){var str=["","1940-2009","0-0-0"];for(var i=0;i<arguments.length;i++){if(arguments[i]. split("-").length==1){str[0]=arguments[i]};if(arguments[i].split("-").length==2){str[1]=arguments [i]};if(arguments[i].split("-").length==3){str[2]=arguments[i]};}str[1]=str[1].split(" -");if(str[2]=="0-0-0"){str[2]=str[1][0]+"-01-01";}str[2]=str[2 ].split("-");str[1][0]=parseInt(str[1][0]);str[1][1]=parseInt(str[1][1]);if(str [2][1].length<2){str[2][1]="0"+str[2][1];}if(str[2][2].length<2){str[ 2][2]="0"+str[2][2];}PPDayselect1(str[0]+"年",str[1][0],str[1][1]-str[1] [0]+1);PPDayselect1(str[0]+"月",1,12);document.getElementById(str[0]+"年").onchange=function(){PPDayselect2(str[0]) ;};document.getElementById(str[0]+"月").onchange=function(){PPDayselect2(str[0]);};document.getElementById(str[0]+"年").value=str [2][0];document.getElementById(str[0]+"月").value=str[2][1];PPDayselect2(str[0]);document.getElementById(str[0]+"日") ").value=str[2][2];
}
function PPDayselect1(ObjectName,StartNum,Length){var o=document.getElementById(ObjectName);o.options.length=Length;var ii;for(var i=0;i<Length;i++){ii=i+StartNum ;if(ii<10){ii="0"+ii;}o.options[i]=新しいオプション(ii,ii);}}
関数 PPDayselect2(str){var DayLength=[31,28,31, 30,31,30,31,31,30,31,30,31];var Year=document.getElementById(str+"年").value;var 月=document.getElementById(str+"月");if(年%4==0){DayLength[1]=29;}else{DayLength[1]=28;}PPDayslect(str+"Day",1,DayLength[Month.olmcct]);}
//-->
</script>