This will fill the combo box with the given month in a given year, days.
<HTML>
<HEAD>
<SCRIPT language="javascript">
function add(dumpMonth, dumpYear) {
var combo = document.getElementById("combo");
days = 32 - new Date(dumpYear, dumpMonth - 1, 32).getDate();
for(i=1; i<=days; i++)
{
option = document.createElement("option");
option.text = i;
option.value = i;
try {
combo.add(option, null);
} catch (error) {
combo.add(option);
}
}
}
</SCRIPT>
</HEAD>
<BODY onload="add(2,2011)">
Select Day: <select name="combo" id="combo"></select>
</BODY>
</HTML>
Hope it helps.