Nadine: Radiobutton in Abhängigkeit vom Datum auswählen

Beitrag lesen

Hallo Martin,

hier ist also der Quelltext:

<script type="text/javascript">
<!--
function Today()
{
  today = new Date();
  currYear = today.getYear();
  currMonth = today.getMonth();
  if (currMonth > 1){checkedMonth = currMonth -1}else (checkedMonth = 11);
document.Auswahl.P_selection[checkedMonth].checked = true;
document.Auswahl.Y_selection[currYear].checked = true
}
-->
</script>

<body onload="Today()">
<form name="Auswahl">
    <br>
    <TABLE Border="0" cellpadding="5" align="center" >
    <TR valign="top"><TD align="right"><font face="Arial" size="2">
    <b>Period</b><br>
     <input type="radio" name="P_selection" value="01">01<br>
     <input type="radio" name="P_selection" value="02">02<br>
     <input type="radio" name="P_selection" value="03">03<br>
     <input type="radio" name="P_selection" value="04">04<br>
     <input type="radio" name="P_selection" value="05">05<br>
     <input type="radio" name="P_selection" value="06">06<br>
     <input type="radio" name="P_selection" value="07">07<br>
     <input type="radio" name="P_selection" value="08">08<br>
     <input type="radio" name="P_selection" value="09">09<br>
     <input type="radio" name="P_selection" value="10">10<br>
     <input type="radio" name="P_selection" value="11">11<br>
     <input type="radio" name="P_selection" value="12">12<br>
      </TD>
<TD align="center"><font face="Arial" size="2">
     <b>Year</b><br>
     <input type="radio" name="Y_selection" value="2003">2003<br>
     <input type="radio" name="Y_selection" value="2004">2004<br>
     <input type="radio" name="Y_selection" value="2005">2005<br>
     <input type="radio" name="Y_selection" value="2006">2006<br>
     <input type="radio" name="Y_selection" value="2007">2007<br>
     <input type="radio" name="Y_selection" value="2008">2008<br>
     <input type="radio" name="Y_selection" value="2009">2009<br>
     <input type="radio" name="Y_selection" value="2010">2010<br>
     </TD>
    </Table>
</body>

Vielen Dank und Gruß,
Nadine