Reputation: 9785
A submit button allows to send it's name
and value
attributes along with the rest of request, when it is clicked, allowing to remember which one of submit buttons was used to send the form data. However, the value sent must be the same text that is displayed on the button. Is there any way for a submit button to send an arbitrary value instead of button text, preferably the way that does not rely on user having JavaScript enabled? Also, is the answer to this question somehow different for XHTML and HTML5?
Upvotes: 0
Views: 120
Reputation: 4457
Try using a button element.
<form method="post">
<button name="abutton" value="abc">foo</button>
</form>
Upvotes: 1
Reputation: 36592
Use a button
instead of an input
:
<button id="butter" type="submit" value="go">Let's do it</button>
Example: http://jsfiddle.net/duySv/
That way the label and value are separate.
Upvotes: 4