2 submit buttons
I have a webpage which has 2 submit buttons.
How do I post
a value to another page based on the button clicked.
Lets say the 2 buttons on the form are yes
and no
. If the yes
button is clicked, I want to post the value 1
, if the no button is clicked, I want to post the value 0
.
Does anyone know how to do this?
It does not have to post 1
and 0
, it can post any value, a开发者_StackOverflow中文版s long as the page being posted to knows which option was selected.
<input type="submit" name="thisismysubmitbutton" value="yes" />
<input type="submit" name="thisismysubmitbutton" value="no" />
One displays and posts the value yes
, the other displays and posts the value of no
. Note that the input
element needs to have a valid name
attribute, else the value
is not posted.
This seems to be what you are looking for: http://www.chami.com/tips/internet/042599i.html
精彩评论