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 Link to comment https://forums.phpfreaks.com/topic/115061-solved-input-typequotimagequot-issue-with-ie/ 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 Link to comment https://forums.phpfreaks.com/topic/115061-solved-input-typequotimagequot-issue-with-ie/#findComment-591694 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 Link to comment https://forums.phpfreaks.com/topic/115061-solved-input-typequotimagequot-issue-with-ie/#findComment-591703 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... Link to comment https://forums.phpfreaks.com/topic/115061-solved-input-typequotimagequot-issue-with-ie/#findComment-591705 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? Link to comment https://forums.phpfreaks.com/topic/115061-solved-input-typequotimagequot-issue-with-ie/#findComment-591731 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 Link to comment https://forums.phpfreaks.com/topic/115061-solved-input-typequotimagequot-issue-with-ie/#findComment-591805 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. Link to comment https://forums.phpfreaks.com/topic/115061-solved-input-typequotimagequot-issue-with-ie/#findComment-591864 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.