Jump to content

Archived

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

SharkBait

IE and <input type="image" />

Recommended Posts

Am I doing this wrong??

[code]
<div style="margin-left: 250px; width: 100px; padding: 5px;">
<input type="hidden" name="uid" value="<?php echo $uid;?>" />
<input type="image" src="images/submit.gif" value="Submit" name="submit" title="Submit"/>
<!-- <input type="submit" value="Submit" name="submit" />  -->
</div>
[/code]

In Firefox it works fine.  The script is executed with no issues. In IE, it just refreshes itself. 
I have a

[code]
<?php
if(isset($_POST['submit'])) {
  echo "I WAS SUBMITTED";
}
?>
[/code]

Firefox shows the I WAS SUBMITED but IE does not.  I commented the <input type="image" out and used the regular <input type="submit" and it works. but I'd rather use the graphic as the button than CSS the form's button.

Share this post


Link to post
Share on other sites
images used as 'submit' buttons do not return their 'name'; they return the x and y co-ordinates of where they were clicked relative to the upper-left corner.  Check for $submit_x and/or $submit_y being set assuming the submit is named 'submit'

Share this post


Link to post
Share on other sites
Instead of [code]<input type="image" src="images/submit.gif" value="Submit" name="submit" title="Submit"/>[/code] I think you should use this: [code]<button type='submit' name='submit'><img src='images/submit.gif' alt='submit' /></button>[/code]

That will make it an actual submit button.

Share this post


Link to post
Share on other sites

×

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.