tags:

views:

97

answers:

3

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>
+1  A: 

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

phantombrain
+1  A: 

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
nickf
+1  A: 

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

Philipe Fatio