OK...now, I understand that Javascript cannot talk to PHP, or at least thats what I have gathered from reading numerous posts lately. I want to do the following:
I have I dropdown menu that contains all the months, values being 1-12. I have a second dropdown that contains day values.
Currently, I am using some php date functions to populate these option values dynamically (based on the date value of some variables sent from the previously clicked-on page), but only for the date originally selected. If you want to change the month value, the day value does not change. I would like the day values to be dependent on the month value that is currently selected, and so my first reaction was to use an onChange="some_function()" in the month select menu. Thing is, if I use Javascript to change the day values based on the month value selected, I run into the static value problem with leap years and all that crap. I can't just define preselected day values for each month value, if I did it would be incorrect once a leap year comes around.
Anyways, getting to the point, what would be the best way to do this??? I would LOVE to be able to just tell Javascript to set the PHP variable $month value to the selected months value! So, PLEASE help....someone....
And, I really do appreciate anyones help, last time I posted something I got absolutely no response...I don't understand why, I cant imagine that you ppl out there at PHPbuilder.com can't help me at all!!!
Please!!! PLEASE!!!!
Here is my code:
<select name="StartDateMonth" class="orangeform" onChange="repop()">
<? for($i = 1; $i <= 12; $i++){ ?>
<option value="<? echo $i ?>" <? if($i == $month){ echo "selected"; }?>>
<? echo date("F", mktime(0, 0, 0, $i, 1, $year)) ?>
</option>
<? } ?>
</select> <select name="StartDateDay" class="orangeform">
<? for($i = 1; $i <= $month_days; $i++){ ?>
<option value="<? echo $i ?>" <? if($i == $day){ echo "selected"; }?>>
<? echo $i ?>
</option>
<? } ?>
</select>
This code is just what I currently have setup to populate the option values based on the date value passed from the previously clicked-on page.
What to do to make the month value change the options in the day select box? I don't know!!!!
PLEASE HELP ME!!!!
Sincerely,
The chick who needs anyones help with this one...