php - Selecting only 1 checkbox (Don't think I can use radio buttons) -
i have bit of issue need with.
i have whole heap of images need either "accepted" or "rejected" page have heap of images accept , reject checkbox , save button @ bottom of page. these images gd generated images string pulled mysql database. these images generated , displayed using while loop in php.
my issue @ moment checkboxes can both selected @ same time , doesnt make sense able accept , reject @ same time. understand radio buttons isn't possible me have form every image , have able distinguish accept/rejection each image in next action page.
this have can't making form on , on while im looping.
echo "<form name=\"selections\" action=\"processselections.php\" method=\"post\">"; echo "<div>"; echo "accept: <input type=\"checkbox\" name=\"accept\" value=\"accept" . $row[0] . " class=\"checkbox\"\"> reject: <input type=\"checkbox\" name=\"reject\" value=\"reject" . $row[0] . "\">"; echo "</div>"; echo "</form>";
you can use radio button
this, add name
radio grouping use your image id
echo "<form name='selections' action='processselections.php' method='post'>"; while($row=mysql_fetch_array($result)) { echo "<div>"; echo "accept: <input type='radio' name='accept_reject_".$row[0]."' value='accept".$row[0]."'/> reject: <input type='radio' name='accept_reject_".$row[0]."' value='reject".$row[0]."'/>"; echo "</div>"; } echo "</form>";
Comments
Post a Comment