我想要有1個選擇框選擇2個paypal按鈕。JQuery選擇多個PayPal按鈕
我有一個最小的形式代碼:
//表單
<form id="form1" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<select name="select1" id="select1">
<option id="option1" value="1">Button1</option>
<option id="option2" value="2">Button2</option>
</select>
<input type="image" src="images/purchase_button.png" border="0" name="submit" alt="PayPal — The safer, easier way to pay online." />
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1" />
</form>
然後在運行時的jQuery會做休息:
$('#select1').change(function() {
if ($('option:selected', this).val() == 1) {
$('#button1').remove(); //clean up
$('#button2').remove(); //clean up
$('#form1').append('<input type="hidden" name="hosted_button_id" value="button1-code-here" id="button1" />');
} else {
$('#button1').remove(); //clean up
$('#button2').remove(); //clean up
$('#form1').append('<input type="hidden" name="hosted_button_id" value="button2-code-here" id="button2" />');
}
});
我的問題是,有時當我選擇選項1按鈕它的提交按鈕2.
是否paypal保存cookie當你去貝寶付款頁面?
這是什麼時候不能順利運行?