Radio Buttons and <INPUT 'hidden'> in a mutliple recor

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rswyatt
Forum Newbie
Posts: 1
Joined: Thu Mar 18, 2004 4:00 pm
Location: Iowa

Radio Buttons and <INPUT 'hidden'> in a mutliple recor

Post by rswyatt »

I have some scragly code listed below...

Basically, my question is this... Say the result of the query gives me 10 records...

Those are displayed in the table below... Notice the radio input and the hidden inputs.

I'm having trouble extracting JUST the value of the one record which I selected with the radio button... Is this not possible?

I should be able to select A radio button - and the POST from the form should give me just the results on the same row as the radio button I selected. I'm missing something though... Anybody care to clue me in? :-)

Thanks,
Rich

Code: Select all

$class1="tableSmall";
$class2="tableTextSmall";
$row_count=0;		

echo "<FORM method='post' action=''>";		
for ($i=0; $i < $flts_num_rows; $i++) &#123;
  $availFlts = mysql_fetch_array($availFltsRslt);
  $row_class=($row_count % 2) ? $class1 : $class2;
  echo "<TR>";
  echo "<TD align='center' class='".$row_class."'><INPUT type='checkbox' name='fltSelect&#1111;$i]' value='".$availFlts&#1111;'id']."'></TD>";
  echo "<TD align='center' class='".$row_class."'>".$availFlts&#1111;'flightID']."<INPUT type='hidden' name='flightID&#1111;$i]' value='".$availFlts&#1111;'flightID']."'></TD>";
  echo "<TD align='center' class='".$row_class."'>".$availFlts&#1111;'origin']."<INPUT type='hidden' name='origin&#1111;$i]' value='".$availFlts&#1111;'origin']."'></TD>";
  echo "<TD align='center' class='".$row_class."'>".$availFlts&#1111;'originID']."<INPUT type='hidden' name='originID&#1111;$i]' value='".$availFlts&#1111;'originID']."'></TD>";
  $availdep&#1111;$i]=substr($availFlts&#1111;'departure'],0,-3);
  echo "<TD align='center' class='".$row_class."'>".$availdep&#1111;$i]."<INPUT type='hidden' name='departure&#1111;$i]' value='".$availdep&#1111;$i]."'></TD>";
  echo "<TD align='center' class='".$row_class."'>".$availFlts&#1111;'destination']."<INPUT type='hidden' name='destination&#1111;$i]' value='".$availFlts&#1111;'destination']."'></TD>";
echo "<TD align='center' class='".$row_class."'>".$availFlts&#1111;'destinationID']."<INPUT type='hidden' name='destinationID&#1111;$i]' 
value='".$availFlts&#1111;'destinationID']."'></TD>";
$availarrive&#1111;$i]=substr($availFlts&#1111;'arrive'],0,-3);
  echo "<TD align='center' class='".$row_class."'>".$availarrive&#1111;$i]."<INPUT type='hidden' name='arrive&#1111;$i]' value='".$availarrive&#1111;$i]."'></TD>";
  echo "<TD align='center' class='".$row_class."'>".$availFlts&#1111;'distance']."<INPUT type='hidden' name='distance&#1111;$i]' value='".$availFlts&#1111;'distance']."'></TD>";
 echo "<TD align='center' class='".$row_class."'>".$availFlts&#1111;'aircraft']."<INPUT type='hidden' name='aircraft&#1111;".$i."]' value='".$availFlts&#1111;'aircraft']."'></TD>";
  echo "<TD align='center' class='".$row_class."'><INPUT type='text' name='pax&#1111;$i]' size='1'></TD>";
  echo "</TR>";
  echo "<TR>";
  echo "<TD><INPUT type='hidden' name='PID' value='".$pSelect&#1111;'PID']."'><INPUT type='hidden' name='hubID&#1111;$i]' value='".$pSelect&#1111;'hubID']."'</TD>";
  echo "</TR>";
  $row_count++;
		&#125;
		
		echo "<TR>";
		echo "<TD colspan='11' align='center'><INPUT type='submit' name='submit' value='Select Flight'></TD>";
		echo "</TR>";	
		echo "</FORM>";
		echo "</TABLE>";
[/php_man]
Post Reply