0 Replies Latest reply on Apr 17, 2011 9:59 AM by JonnyDL

    PHP/html form

    JonnyDL Level 1

      I'm trying to find a way to place  the date in a field, and have it change if the button is changed.

      is PHP not able to do it and I need to feed in the fields via a JAvascript, and the use PHP to get the info from the field?

       

      hear is what I have

       

      <?php

      $today=getdate();

      $year=$today['year'];

      $month=$today['month'];

      $monthnum=$today['mon'];

      $day=$today['mday'];

      $wday=$today['wday'];

      $numdays=cal_days_in_month(CAL_GREGORIAN, $monthnum, $year);

       

      $html='<select name=date onChange='.'showme()'.'>';

      while($count <=$numdays)

      {

      if ($count == ($day+1))

      $rightDate='selected';

      else

      $rightDate='null';

      $html.='<option value='.$count.' '.$rightDate.'>'.$count.'</option>';

      $count++;

      }

      $html.='</select>';

       

      echo $html;

       

      function showme ()

      {

      echo "hit";

      }

       

       

      ?>