0
我試圖提交數據的這種形式,其中有3個不同的按鈕:提交表單的數據進行動態ID
<form action="/game.php?village=8404&screen=market&mode=own_offer&action=modify_offers&h=85fd1491" method="post">
<input class="btn btn-cancel" type="submit" value="Delete" name="delete">
<input type="text" size="2" name="mod_count" value="1" onkeydown="return no_enter(event)">
<input class="btn" type="submit" value="Increase" name="increase">
<input class="btn" type="submit" value="Reduce" name="decrease">
</form>
我想無論是在「增加」相同的方式提交數據或點擊提交按鈕。理想情況下,我不需要複製form action=
之後顯示的網址,因爲每頁頁面都有所不同。
當窗體上有一個明確的ID,我一直在使用:
$('#thisFormId input[type=submit]').click();
但不能工作了。
那麼在這種情況下我該怎麼做呢?
你可以稍微修改你的game.php文件嗎?如果是這樣,你可以發送一個帖子屬性_action_(例如),告訴你增加還是減少被點擊。您可以根據用戶點擊的位置分配_action_的值。 – Kruser