一个表单,两个提交按钮,用于两个不同的隐藏值

问题描述 投票:0回答:1

我有一个基本的投稿表格,可以将一些数据提交到SMS网关。隐藏的字段“消息”之一是我希望发送的消息文本。我需要针对两个不同位置(案例1和案例2)的两个提交按钮-每个按钮都会在“消息”值中传输不同的文本。由于数据已发送到第三方网关,因此我无法在服务器端进行任何操作。有什么建议吗?

当前代码是:

我只需要两个提交按钮-一个用于case1,一个用于case2。

<form action="https://gatway.com/send.php" method="post">
<input name="key" type="hidden" value="APIKEYxxxxx" />
<input name="message" type="hidden" value="message to send in case 1" />
<input name="message" type="hidden" value="message to send in case 2" />
To: <input name="to" type="text" />
<input name="username" type="hidden" value="username" />
<input name="from" type="hidden" value="+44xxxxxxxxxx" />

<input type="submit" value="Submit" /></form>
php html forms submit
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.