Jump to content


Photo

How do I get radio buttons to work with IE6???


  • Please log in to reply
5 replies to this topic

#1 rgrne

rgrne
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 03 September 2006 - 10:59 PM

Note: I have posted this on the HTML forum too, since it probably has something to do with the way that IE6 interprets HTML, but I'm not entirely sure, so here's another post in the PHP section...

I just noticed that a group of radio buttons in a website I am developing don't work with Internet Explorer 6.  They work fine with IE5, Mozilla, and Firefox.  The only references to this problem that I have been able to find are related to Javascript and they present work arounds that use Javascript.  But I am not using Javascript, just PHP and HTML. Are there any options to work around this using just HTML or PHP?

This is the code that I am using. The PHP is just being used to print HTML script.  These lines occur inside a for loop that changes the value of  $entry2 for each button.

print "<tr align=\"center\" valign=\"middle\">"; 
      print "<td><input type=\"radio\" name=\"game\"  value=\"$entry2\" /></td>";
      print "<td>$entry1</td>";
      print "<td>$entry2</td>";
      print "<td>$entry3</td>";
      print "<td>$entry4</td>";   
      print "<td><input type=\"hidden\" name=\"gamepass\" value=\"$entry5\" /></td>";
      print "</tr>";

I also tried being more XHTML complient by including an ID tag that was different for each button, but to no avail:

print "<tr align=\"center\" valign=\"middle\">"; 
      print "<td><input type=\"radio\" name=\"game\" id=\"$entry2\" value=\"$entry2\" /></td>";
      print "<td>$entry1</td>";
      print "<td>$entry2</td>";
      print "<td>$entry3</td>";
      print "<td>$entry4</td>";   
      print "<td><input type=\"hidden\" name=\"gamepass\" value=\"$entry5\" /></td>";
      print "</tr>";

Any suggestions?

#2 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 03 September 2006 - 11:05 PM

echo '<tr align="center" valign="middle"/>';
echo '<td><input type="radio" name="game" value="'.$entry2.'"/></td>';
echo "<td>".$entry1."</td>";
echo "<td>".$entry2."</td>";
echo "<td>".$entry3."</td>";
echo "<td>".$entry4."</td>";
echo '<td><input type="hidden" name="gamepass" value="'.$entry5.'"/></td></tr>';   


Try something like that.. might work for you...  Same basic syntax I use on my forms... 

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 September 2006 - 11:13 PM

html format with php enbeded
example only

edited as advised from below post
<?php
       <tr align="center" valign="middle">  
       <td><input type="radio" name="game"  value="<?php echo $entry2; ?>" ></td> 
       <td><?php echo $entry1;?></td>
       <td><?php echo $entry2;?></td>
       <td><?php echo $entry3;?></td>
       <td><?php echo $entry4;?></td>    
       <td><input type="hidden" name="gamepass" value="<?php echo $entry5; ?>" ></td>
       </tr>



 <tr align="center" valign="middle"> 
       <td><input type="radio" name="game" id="<?php echo $entry2;?>" value="<?php echo$entry2;?>" ></td> 
       <td><?php echo $entry1;?></td>
       <td><?php echo $entry2;?></td>
       <td><?php echo $entry3;?></td>
       <td><?php echo $entry4;?></td>    
       <td><input type="hidden" name="gamepass" value="<?php echo $entry5;?>" ></td>
       </tr>
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 03 September 2006 - 11:20 PM

yes that way would work too redarrow lol...  except for the fact that you've got no ; after your echo statements its like flawless.. ;)

#5 rgrne

rgrne
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 04 September 2006 - 01:27 AM

Thanks.  Tried radar's code and it didn't work - but it did make me look at what was happening in the page again and I found that I had a more exotic, but easily fix-able problem.  An image outside the table, below it, was creating some kind of "shadow" that was only allowing the buttons that were directly above it to operate - so I got rid of the image.

Anyway, radar and redarrow - I notice that you both recommended using echo statements instead of the print statements that I was using.  I learned PHP from an old-ish circa 2000 book that used print and didn't even mention echo.
I've noticed that everyone else seems to use echo - has print been more or less deprecated?

PS: I thought there was some way to flag a topic as "solved."  Can't seem to find it. 



#6 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 04 September 2006 - 02:04 AM

print still works for some things though i like echo much more...  Though i figure at one point print will be taken out of php at all...  other than the print_r and other print functions...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users