Jump to content
Larry Ullman's Book Forums

What Will Actually Be Sent To Server From Radio Selection?


Recommended Posts

What will the server receive following submit against the following input?

 

while ($row = mysqli_fetch_assoc($result))
{
echo "<tr>";
echo "<td><input type='radio' name='recis' value='".$row['c_id']."'></td>";
echo "<td>".$row['c_username']."</td>";
echo "<td>".$row['c_flag']."</td>";
echo "<td>".$row['c_match']."</td>";
echo "<td>".$row['c_element']."</td>";
echo "<td>".$row['c_patname']."</td>";
echo "<td>".$row['c_patdate']."</td>";
echo "</tr>";
}

 

The 'c_id' contains the record number for that $row so hopefully the only item returned after the user is shown a list of table entries, will be one of the items selected by clicking the radio button that is set to be = to it's table entry or record number...

 

I can't figure out what to grab on the server side to test that nothing was selected or to pass on the 'recis' to be used in the next page... I assume that it will only be one  $_POST['recis'] is that right? Or is it going to return an array of all the radio buttons with someway for me to tell which one was selected?

 

Thanks as always for any help...

Link to comment
Share on other sites

I found it and I was just about right...

 

I changed my radio name= from 'recis' to 'c_id' which was one of my case table fields for record id anyway. I was also trying to track down a fatal error: Undefined index:  recis that went away when I changed the name. My answer of what was being returned to the server was confirmed by holding the record to process in $_SESSION['c_id'] = $_POST['c_id']; Only one of the selected radio entries were passed to the server as expected and the value attribute above did capture the correct record id to pass along.

 

Hope additional people out there learned as much from this as I did...

 

Ready to move on now to really less simple stuff...

Link to comment
Share on other sites

 Share

×
×
  • Create New...