By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,278 Members | 1,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,278 IT Pros & Developers. It's quick & easy.

type=image not working as I expected in IE

banning
P: 42
Ok this makes no sense to me seeing as how PHP should work regardless of the browser... or am i wrong on that? ANYWAY here...

[HTML]<form action="<? $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data">
<input type="image" name="submit1" value="submit1" src="imgs/uploadimg.jpg" width="169" height="35" />[/HTML]

there is the HTML code for the form now the php

[PHP]if(isset($_POST['submit1'])){
do php stuff
}[/PHP]

and thats the php... i dont know im flipping lost cause it works fine in FireFox (of course) what i am assuming is that im usying input type="image" instead of input type="submit" and IE wants to hate me for it... LOL yea as always any and all input would be had thanks in advance for your help :)
Feb 24 '08 #1
Share this Question
Share on Google+
7 Replies


banning
P: 42
ok so i tried it real quick wit input type="submit" and it worked.. (idk why i didn't try that before i posted) HOWEVER!!! lol i still would like to know why input type="image" worked in firefox but not IE... cause yeah id really like to have a custom button.. and i really dont wanna write a bunch of javascript just to get it...
Feb 24 '08 #2

Markus
Expert 5K+
P: 6,050
Here's something interesting for you:
With image submits, you'll get 2 name/value pairs when the button is clicked. For 'restore', the browser will send 'restore.x' and 'restore.y', and the values are the x/y coordinates of where they clicked on the image.

Try
[php]
if (isset($_POST['restore'] isset($_POST['restore_x']))
{
code..
}
[/php]
..and you'll be fine.

note that PHP will turn the '.x' suffix into a '_x'...
There's more interesting work arounds on the board i got that ^ snippet from http://www.webmasterworld.com/forum88/4894.htm
Feb 24 '08 #3

banning
P: 42
here is what i ended up doing

[HTML]<input type="hidden" name="submit" value="submit">
<input type="image" src="url" />[/HTML]
Feb 24 '08 #4

TheServant
Expert 100+
P: 1,168
here is what i ended up doing

[HTML]<input type="hidden" name="submit" value="submit">
<input type="image" src="url" />[/HTML]
So you put that in a table cell or tags or what? Just curious because I wanted to do a similar thing ages ago but couldn't get it to work.
Feb 25 '08 #5

banning
P: 42
So you put that in a table cell or tags or what? Just curious because I wanted to do a similar thing ages ago but couldn't get it to work.
I am afraid i don't understand your question... sorry i'm not on here often i don't usually expect people to have questions for me haha.... but if you're still around and you get this id love to answer your question, just not quit sure what exactly your asking.
Mar 5 '08 #6

Markus
Expert 5K+
P: 6,050
So you put that in a table cell or tags or what? Just curious because I wanted to do a similar thing ages ago but couldn't get it to work.
You just put it in a form :)
Mar 5 '08 #7

TheServant
Expert 100+
P: 1,168
You just put it in a form :)
lol, cheers guys, I will have a go later.
Mar 5 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.