【发布时间】:2019-10-02 11:00:45
【问题描述】:
我有一个基本的发布表单,可以将一些数据提交到 SMS 网关。 隐藏字段之一“消息”是我希望发送出去的消息文本。 对于两个不同的位置(case1 和 case2),我需要两个提交按钮 - 每个按钮在“消息”值中传输不同的文本。 当数据被发送到第三方网关时,我无法在服务器端做任何事情。 有什么建议吗?
当前代码是:
我只需要两个提交按钮 - 一个用于 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>
【问题讨论】:
-
如果您可以编辑表单,那么您可以使用javascript onSubmit 在表单参数中添加更改。编辑form.action,例如