Submit form submit button value?

I was wondering if you can put 2 submit buttons, if you send them any information when clicked.

Example:

<form method="post" action="content/requests/index.cs.asp?Process=RespondRequests" id="REQUESTFORM"> <input type="hidden" name="REQUESTID" value="<%=objRequests("REQUESTID")%>"> <input type="hidden" name="BYID" value="<%=objRequests("BYID")%>"> <input type="hidden" name="TOID" value="<%=objRequests("TOID")%>"> <input type="submit" name="respond" value="Confirm" class="btn_confirm" /> <input type="button" name="respond" value="Ignore" class="btn_ignore" /> </form> 
+4
source share
3 answers

Given your code there, if you change the ignore button to type="submit" , then it will do what you want.

In POST you will see the following:

 // if Confirm clicked: REQUESTID -> requestId BYID -> byId TOID -> toId respond -> Confirm // if Ignore clicked: REQUESTID -> requestId BYID -> byId TOID -> toId respond -> Ignore 
+8
source

Remember that hitting the enter button on a form is like hitting a submit button that appears first in your source.

+5
source

Just set them as type = "submit". This will already be done.

+1
source

All Articles