我有一個貝寶的形式如下:(某些字段使用jQuery加)提交使用貝寶JS形式不工作
<form method="post" action="https://www.paypal.com/cgi-bin/webscr"> <input type="hidden" value="_s-xclick" name="cmd"> <input type="hidden" value="sdfgsdfg" name="hosted_button_id"> <input type="button" value="Purchase One Year License" name="submit" class="pp_button" id="35" style="background-color: rgb(255, 255, 255);"> <input type="hidden" value="35" name="cs_project_id"> <input type="hidden" value="6d04c7a241ad4415eb194a90dc252b09" name="cs_transaction_id"> </form>
我試圖使用使用第三input
元素(type="button"
)提交表單驗證碼:
$(".pp_button").click(function() { var button = $(this); button.parent().submit(); });
這應該很好地工作吧?由於click()
函數後面的其他部分,我正在使用var button
。我檢查了button.parent()
的tagName
,它的編號爲FORM
,所以這很好...
我在這裏做了什麼錯?這通常工作正常...是因爲我從AJAX調用插入標籤(最後兩個input
標籤)?還有別的嗎?我的桌子上缺乏成熟的切達乾酪?
感謝,
詹姆斯
令人煩惱的是我不能改變名字(至少我認爲);它可能會以某種方式被PayPal使用......我會用另一個名字來測試它。 – Bojangles 2011-03-11 15:23:58
Yeaop ...我收到一個錯誤:-(Dang。 – Bojangles 2011-03-11 15:24:41