View Full Version : Calendar dependent on radio button

08-24-2010, 05:49 AM
I am working a form with radio button and calendar. What I would like to do is when the user selects Done - be able to display the calendar and if Not Done is selected, disable the calendar.

Here is my code:

<td class="tajuk_kecil"><div align="right">Status </div></td>
<td class="tajuk_kecil"><div align="center">:</div></td>
<label><input name="status" type="radio" value="Done" checked>Done </label>
<label><input name="status" type="radio" value="Not Done">Not Done</label>
</tr >

<td class="tajuk_kecil"><div align="right">Date</div></td>
<td class="tajuk_kecil"><div align="center">:</div></td>

$myCalendar = new tc_calendar("date5", true, false);
$myCalendar->setDate(date('d'), date('m'), date('Y'));
$myCalendar->setYearInterval(2000, 2015);
$myCalendar->dateAllow('2008-05-13', '2015-03-01');
$myCalendar->setDateFormat('j F Y');
?> </td>


Any suggestions would be greatly appreciated. Thanx

08-24-2010, 03:05 PM
this would imply the user submitting the form as PHP (on the server) cannot react to user interaction (on the client).