Hi,

I have some checkboxes on my form and am using the following code to
populate it. The box will be checked if the user is allocated to the
project. My problem is if I uncheck a checkbox and send the form I don't
know what the $project_id is as it returns zero, so I cant delete the
corresponding record, is there a way around this?


while($j < $num){
  $project_id = mysql_result($result, $j, Project_ID);
  $project_name = mysql_result($result, $j, Project_Name);
  echo   '<tr>
       <td height="30">'.$project_name.':</td>
       <td><input name="'.$project_id.'" type="hidden" value="0">
         <input name="'.$project_id.'" type="checkbox"
value="'.$project_id.'" ';
         $k = 0;
         while ($k < $num_elements){
          if ($project_id == $project_id2[$k]){
           echo 'checked';
          }
          $k++;
         }
   echo  '></td>
      </tr>';
  $j++;
 }



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to