Jump to content

IE and <input type="image" />


SharkBait

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.

Link to comment
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'
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.