/    Sign up×
Community /Pin to ProfileBookmark

Multiple Image Submit Buttons

I have a form in which i need 3 submit buttons and then based on its value, use PHP to do different things

<form>
<p class=”buttons”><input type=”image” src=”../images/btn_review.gif” name=”submit” id=”submit” value=”review” />&nbsp;&nbsp;&nbsp;<input type=”image” src=”../images/btn_save_back.gif” name=”submit” id=”submit” value=”save” />&nbsp;&nbsp;&nbsp;<input type=”image” src=”../images/btn_save_cont.gif” id=”submit” name=”submit” value=”continue” /></a></p>
</form>

The problem is it works perfectly fine in FF but does not work in IE

FF submits the value of “submit” as review, save and continue depending on what is clicked but IE does not submit any value for “submit” .. am I doing something wrong or is there a better way for doing it ?

Neel

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisNov 24.2008 — IE does not support "value" for input type="image". You will only get the x and y coordinates of the mouse click in the submission.

See http://msdn.microsoft.com/en-us/library/ms535836(VS.85).aspx
Copy linkTweet thisAlerts:
@swapdudeauthorNov 24.2008 — Is there any solution to this ?
Copy linkTweet thisAlerts:
@gil_davisNov 24.2008 — In the querystring, you should get...submit.x=...&amp;submit.y=...So if you change the name of each button to the value you wanted, you should be able to pull the data out in either FF or IE.

If you don't like that solution, you can use an link instead of an input type="image", but that would fail if someone has javascript disabled.
Copy linkTweet thisAlerts:
@CharlesNov 24.2008 — And you might try using the BUTTON element instead of the INPUT, [i]id est:[/i]&lt;button type="submit" value="review"&gt;&lt;img alt="review" src="review.png"&gt;&lt;/button&gt;
×

Success!

Help @swapdude spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.11,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...