Multiple submits in an HTML form

Posted by StackOverflowNewbie on Stack Overflow See other posts from Stack Overflow or by StackOverflowNewbie
Published on 2012-03-23T03:39:31Z Indexed on 2012/03/24 5:29 UTC
Read the original article Hit count: 172

Filed under:
|
|

I have an HTML form that needs multiple submit buttons, like this:

<input type="submit" name="foo" value="1"/>
<input type="submit" name="foo" value="2"/>
<input type="submit" name="foo" value="3"/>

The problem is that I want it to display on the button something other than what is in the value attribute (in the example above: 1, 2, 3). For example, I want to show "Bar" for the button with value="1". Is this possible?

I've considered using the <button> tag, like this:

<button name="foo" value="1">Bar</button>

The problem with using <button> (from w3schools):

If you use the element in an HTML form, different browsers may submit different values. Internet Explorer, prior version 9, will submit the text between the and tags, while other browsers will submit the content of the value attribute. Use the element to create buttons in an HTML form.

Thoughts?

© Stack Overflow or respective owner

Related posts about html

Related posts about XHTML