faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

22 of 83 people (27%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

Since IE 5.x doesn't pass the name/value pairs of a submit button, how can you use multiple submit buttons in a way that works with IE?

Mar 23rd, 2001 14:33
Ben Udall, Ben Munoz, josh sisk,


IE 5.x _does_ pass submit button name/value pairs.  There was probably 
something else interfering with the form submit.
This will let you use images as submit buttons:
<form action="whatever.phtml">
<input type="image" name="button1" src="button1.gif" border="0" />
<input type="image" name="button2" src="button2.gif" border="0" />
</form>
Then in the processing form:
<?
if (isset($button1_x)) {
    # The person clicked button 1 to submit the form
} elseif (isset($button2_x)) {
    # The person clicked button 2 to submit the form
}
?>