Jump to content

[SOLVED] Input type="image" issue with IE


dartfrogs

Recommended Posts

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

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

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.