6

I was wondering if it is possible to place 2 submit buttons if send either of its information when click.

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> 

3 Answers 3

9

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

In the POST, you'll see this:

// if Confirm clicked: REQUESTID -> requestId BYID -> byId TOID -> toId respond -> Confirm // if Ignore clicked: REQUESTID -> requestId BYID -> byId TOID -> toId respond -> Ignore 
Sign up to request clarification or add additional context in comments.

Comments

5

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

Comments

1

Just set them both to type="submit". It will already do that.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.