如果一個表單有兩個提交按鈕,那麼我需要通過jquery提交一個表單作爲觸發提交按鈕之一的提交。在jquery中通過觸發sumbit按鈕之一提交表單
<?php
if(isset($_REQUEST['submit_button1']))
{
echo "form submitted by clicking submit button 1";
}
elseif(isset($_REQUEST['submit_button2']))
{
echo "form submitted by clicking submit button 2";
}
?>
<form name="check" action="">
<input type="text" name="text_val" id="text_val">
<input type="submit" name="submit_button1" value="submit button1">
<input type="submit" name="submit_button2" value="submit button2">
</form>
問題:$("form[name='check']").submit()
提交表單的腳本。我需要通過提交表單來提交表單,通過在jquery中提交按鈕1或提交button2來提交表單。
請幫我提前...
哈哈......在我輸入我的答案的時候,其他3個人輸入了相同的答案。 – iWantSimpleLife