2012-03-06 89 views
0

我需要找到一种方法来自动提交此表为单独提交按钮,使用JavaScript,使我能够做这样的事:自动提交表单有多个提交按钮

thispage.php? go = gold - 当用户点击此页面时(如果?go = gold在URL中),将立即自动点击“黄金会员资格”的提交按钮。

我不需要PHP的任何帮助,只需提交一个特定的提交按钮的Javascript。

if ($_GET['go'] == 'gold') { 
    '** need the code I would put here to auto submit the form for the gold button' 
} 

(((格式化为便于阅读除去)))

<form action="payments.php?do=order" method="post" name="MiFormulario"> 

<input type="hidden" name="s" value="" /> 

<input type="hidden" name="securitytoken" value="1331068360-a3bc1dae4834781f33c7100b66bade8f8d17fafd" /> 

<input type="hidden" name="do" value="order" /> 









<legend>Silver Membership</legend> 


Cost:<br /> 

<select name="currency[4]" style="width:125px"><optgroup label="3 Months *"> 
<option value="0_usd" >US$597.00</option> 
</optgroup> 
</select> 

<input type="submit" class="button" name="subscriptionids[4]" value="Order" style="font-weight:normal" /> 









<legend>Gold Membership</legend> 



Cost:<br /> 

<select name="currency[3]" style="width:125px"><optgroup label="3 Months *"> 
<option value="0_usd" >US$997.00</option> 
</optgroup> 
</select> 

<input type="submit" class="button" name="subscriptionids[3]" value="Order" style="font-weight:normal" /> 








<legend>Platinum Membership</legend> 

Cost:<br /> 

<select name="currency[2]" style="width:125px"><optgroup label="6 Months *"> 
<option value="0_usd" >US$1,997.00</option> 
</optgroup> 
</select> 

<input type="submit" class="button" name="subscriptionids[2]" value="Order" style="font-weight:normal" /> 








Cost:<br /> 

<select name="currency[1]" style="width:125px"><optgroup label="1 Year *"> 
<option value="0_usd" >US$50.00</option> 
</optgroup> 
</select> 

<input type="submit" class="button" name="subscriptionids[1]" value="Order" style="font-weight:normal" /> 






</form> 

回答

0
echo "<script type='text/javascript'> $('formId').submit(); </script>";