Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calendar dependent on radio button

    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:

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

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

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

    </tr>

    Any suggestions would be greatly appreciated. Thanx

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,350
    Thanks
    13
    Thanked 349 Times in 345 Posts
    this would imply the user submitting the form as PHP (on the server) cannot react to user interaction (on the client).
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •