Форма автоматической отправки с несколькими кнопками отправки - PullRequest
0 голосов
/ 07 марта 2012

Мне нужно найти способ автоматической отправки этой формы для отдельной кнопки отправки с помощью 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>

1 Ответ

0 голосов
/ 07 марта 2012
echo "<script type='text/javascript'> $('formId').submit(); </script>";
...