One thing was a form. I wanted to be able to make the day in a drop down list populate according to the month. I can get everything working fine, just not the changing of the days to coincide with the months.
Doing some googling I found this code:
function days_of_month($month = false){
$aDateTime = getdate();
for ($i = 1; $i < 13; $i++){
switch ($i){
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
$aMonthDays[$i] = 31;
break;
case 4:
case 6:
case 9:
case 11:
$aMonthDays[$i] = 30;
break;
case 2:
if (checkdate($i, 29, $aDateTime["year"])) {
$aMonthDays[$i] = 29;
} else {
$aMonthDays[$i] = 28;
}
break;
}
}
if ($month){
return $aMonthDays[$month];
} else {
return $aMonthDays;
}
}
but without any info to go along with it. I can see what it is doing. It is quite simple in what it does and does what pictured in my mind, just syntactically correct, I guess. My problem is I do not know how to implement this function into the actual page. Particularly, I dont exactly understand the parameters of the function. I know I basically have to do onChange(days_of_monthXXXX) type of deally, but Im not sure exactly how to go about it Any insight is appreciated.


Sign In
Create Account

Back to top









