发送表单的提交按钮的值? [英] sending form's submit button's value?

查看:72
本文介绍了发送表单的提交按钮的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以放置2个提交按钮,以便在单击时发送其任何一个信息.

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

示例:

 <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>  

推荐答案

在此处给出代码,如果将忽略按钮更改为type="submit",它将执行您想要的操作.

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

在POST中,您将看到以下内容:

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

这篇关于发送表单的提交按钮的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆