473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

type=image not working as I expected in IE

banning
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
7 2128
banning
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
6,050 Expert 4TB
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
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
1,168 Expert 1GB
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
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
6,050 Expert 4TB
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
1,168 Expert 1GB
You just put it in a form :)
lol, cheers guys, I will have a go later.
Mar 5 '08 #8

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

Similar topics

2
by: Colin Steadman | last post by:
I have two buttons on my form and need to know which was clicked. If I setup the buttons like this: <input type="submit" value="submit" name="submit_to_array"> <input type="submit"...
4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
1
by: Wayne | last post by:
Please help... For some odd reason onclick is not working with and <input type="image"> but works fine on an <input type="button">.... This does not work: <input TYPE="image" src="go.gif"...
2
by: Kimmo R. M. Hovi | last post by:
Currently I have defined: -- clip clip -- <form method="post" action="xx" enctype="application/x-www-form-urlencoded"> <input type="image" name="Function 1" src="image1.gif" border="0"...
1
by: Brian Genisio | last post by:
Hi all, I noticed that the image input type does not show up in the elements array (IE 6.0). <FORM name=myForm> <INPUT name=rads id=check1 type=radio value=val1> <INPUT name=rads id=check2...
2
by: jw56578 | last post by:
if i have an Input type Image how am i suppose to programatically submit it through JS. code: <INPUT type="text" onkeyup="javascript:if(event.keyCode==13){btnClick.click();}"> <INPUT...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
3
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image'...
0
shane3341436
by: shane3341436 | last post by:
I used input type=image in my page.So that when user clicks on this field the page is submitted. The input-image field is working quite well in mozilla. But when same page is run in IE the form is...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.