0

Hi,

I'm displayin data in my database in a table form using a for loop . In my loop i added a radiobutton so that a selected radio button would identify the row on the table. This is the code is used:

for($j=0;$j<=$nrows2;$j++){
		while($row = mysql_fetch_row($result)){
               
                print "<tr><td>".$row [0]."</td><td>".$row [1]."</td><td>".$row [2]."</td><td><input type=radio name=".$j." value=".$j."</td></tr>";
				
            }
			}

My problem is i tried the following code hoping it would identify which radiobutton was selected but it is non responsive

if(isset($_POST['ed']))
				{
	
	echo $_POST[$j];
	
			}

Thanks.

2
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by CFROG
0

The value and names of your radio buttons are going to be numbers, not names (or text).

//This will not do anything for you:
if(isset($_POST['ed']))
0

hi

the POST is for the button. i wanted to test if it would display the value of radio button that was checked but it didnt display anything

0

hi

the POST is for the button. i wanted to test if it would display the value of radio button that was checked but it didnt display anything

0

i thought that echoing $_POST[$j] would display the selected radio button but it doesnt n' i'm fresh out of ideas

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.