Link to home
Create AccountLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

2d checkboxes that are similar to 2d radio

<?php // RAY_temp_rgb192.php
error_reporting(E_ALL);

// SHOW THE LOCATION OF THE SELECTION IN THE MATRIX
if (!empty($_POST))
{
    $arr = explode('_', $_POST['x']);
    $row = str_replace('R', NULL, $arr[0]);
    $col = str_replace('C', NULL, $arr[1]);
    echo "<br/>YOU CHOSE ROW $row AND COLUMN $col<br/>";
}

$html = <<<ENDHTML
<form method="post">
Choose a Radio Button
<table>
<tr>
<td><input type="radio" name="x" value="R1_C1" /></td>
<td><input type="radio" name="x" value="R1_C2" /></td>
<td><input type="radio" name="x" value="R1_C3" /></td>
</tr>
<tr>
<td><input type="radio" name="x" value="R2_C1" /></td>
<td><input type="radio" name="x" value="R2_C2" /></td>
<td><input type="radio" name="x" value="R2_C3" /></td>
</tr>
<tr>
<td><input type="radio" name="x" value="R3_C1" /></td>
<td><input type="radio" name="x" value="R3_C2" /></td>
<td><input type="radio" name="x" value="R3_C3" /></td>
</tr>
</table>
<input type="submit" />
</form>
ENDHTML;

echo $html;

Open in new window



this is a great 2d array form radio buttons
how can I modify for checkboxes
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of rgb192

ASKER

even simpler to understand than the split ( | ) code I am currently using

thanks