Probeer de onderstaande code
Fouten
- Eerst heb je
POST
gebruikt metod in vorm en krijg variabele met behulp vanGET
-
Je kunt het hieronder proberen om de waarde van het selectievakje te krijgen
if ($subssm) { <input type='checkbox' name='subssm[]' value='1' /> }else{ <input type='checkbox' name='subssm[]' value='0' /> }
*PHP *
<form name="staff" method="get" onsubmit="return validateForm()" action="commit.php?action=<?php echo $_GET['action'] ?>">
<tr>
<td height="12" align="right" bgcolor="#CCCCCC"><h5> </h5></td>
<td height="12" align="left" bgcolor="#dfdfdf"> <input type="checkbox" name="subagent[]" value="<?php echo $subagent; ?>" /> Agent <input type="checkbox" name="subum[]" value="<?php echo $subum; ?>" /> UM </td>
<td rowspan="2" align="left" bgcolor="#dfdfdf">
<h6> * Selected one or more</h6></td>
</tr>
<tr>
<td height="12" align="right" bgcolor="#CCCCCC"><h5> </h5></td>
<td height="12" align="left" bgcolor="#dfdfdf">
<?php
if ($subssm) {
<input type='checkbox' name='subssm[]' value='1' />
}else{
<input type='checkbox' name='subssm[]' value='0' />
}
?>
SSM <input type="checkbox" name="subtutor[]" value="<?php echo $subtutor; ?>" /> Tutor </td>
</tr>
<input type="submit" name="Submit" value="<?php echo $_GET['action'] ?>" />