dartfrogs Posted July 16, 2008 Share Posted July 16, 2008 Okay I have searched and searched for a good alternative to the problem with IE using images as a submit button. (took me a while to find out this was an iusse) What I have and works great in FF is: function Getflags() { $res = sql_select_country(); $cid = $_POST['flag']; $flags = '<form action="display.php" method="post"><table>'; while($resultset = @mysql_fetch_array($res)) { $id = $resultset['id']; $country = $resultset['country_name']; $flag = $resultset['flag_image']; $flags .=' <tr> <td>'. $country .'</td> //submit button returns $id fine with $_POST in FF not IE!!! <td><input type="image" src="'. $flag .'" name="flag" value="'.$id.'" /></td><td></td> </tr> '; //$i += 1; } $flags .=' </table></form>'; mysql_free_result($res); return $flags; } So my question is without using hidden fields, or image coords. what is a good alternative solution? ??? Help Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted July 16, 2008 Share Posted July 16, 2008 function Getflags() { $res = sql_select_country(); $cid = $_POST['flag']; $flags = '<form name="form" action="display.php" method="post"><table>'; while($resultset = @mysql_fetch_array($res)) { $id = $resultset['id']; $country = $resultset['country_name']; $flag = $resultset['flag_image']; $flags .=' <tr> <td>'. $country .'</td> //submit button returns $id fine with $_POST in FF not IE!!! <td><input type="image" src="'. $flag .'" onclick="document.form.submit();" name="flag" value="'.$id.'" /></td><td></td> </tr> '; //$i += 1; } $flags .=' </table></form>'; mysql_free_result($res); return $flags; } added form name added onclick to image Quote Link to comment Share on other sites More sharing options...
MadTechie Posted July 16, 2008 Share Posted July 16, 2008 I'm the in same boat.. you can try a standard image inside a hyperlink with border set to 0.. (could use a javascript to set a field and then submit) or standard a html form button. it was a real pain anyway i thats all i have and i hope that helps Quote Link to comment Share on other sites More sharing options...
dartfrogs Posted July 16, 2008 Author Share Posted July 16, 2008 Added a form name and the onclick still no work... Bummer... Quote Link to comment Share on other sites More sharing options...
dartfrogs Posted July 16, 2008 Author Share Posted July 16, 2008 How do I make the image a link? And have it pass a value at the same time? Quote Link to comment Share on other sites More sharing options...
MadTechie Posted July 16, 2008 Share Posted July 16, 2008 try this <a href="?var=foo"><img src="images/img.jpg" border="0"></a> of course the href could also be used to call a JS Quote Link to comment Share on other sites More sharing options...
dartfrogs Posted July 16, 2008 Author Share Posted July 16, 2008 Hey thank you I got it figured out and got things working. What I had to do was go this route: function Getflags() { $res = sql_select_country(); $cid = $_GET['cid']; $flags = '<form action="display.php" name="form" method="post"><table>'; while($resultset = @mysql_fetch_array($res)) { $id = $resultset['id']; $country = $resultset['country_name']; $flag = $resultset['flag_image']; $flags .=' <tr> <td>'. $country .'</td> <td><a href="display.php?cid='.$id.'"><img src="'. $flag .'" name="flag"" border="0"></a></td> <td></td> </tr> '; //$i += 1; } $flags .=' </table></form>'; mysql_free_result($res); return $flags; } The right value is passed through and so far it works in both IE and FF. Thanks for the help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.