启用带有复选框的PayPal按钮

Enabling PayPal buttons with a checkbox

本文关键字:PayPal 按钮 复选框 启用      更新时间:2023-09-26

说到编码,我有点不喜欢,但说到这里,希望有人能帮忙。我被要求使用两个贝宝按钮建立一个支付页面。当你第一次到达页面时,按钮需要被禁用,直到他们选中复选框,这基本上意味着他们已经接受了ToS,并且可以继续付款。我已经尝试了所有我能在网上找到的东西,但似乎没有什么对我有用。

这是我的html代码。。。

    <!--CheckBox Validation-->
    <input id="one" type="checkbox" /> I have read and agree to the Terms &amp; Conditions

    <!--PayPal Button-->
    <center>
    <table>
<tr>
    <td>
    <form action="https://www.paypal.com/cgi-bin/webscr" onsubmit="return confSubmit();"              method="post" target="_top">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="2RU2ND26N2564">
    <input type="image" src="http://graphicasylum.com/images/Boton_100_Chico.png" border="0" name="submit" alt="PayPal, la forma más segura y rápida de pagar en línea.">
    <img alt="" border="0" src="https://www.paypalobjects.com/es_XC/i/scr/pixel.gif" width="1" height="1">
    </form>
    </td>
    <td>
<a class="submit disabled"
    <form action="https://www.paypal.com/cgi-bin/webscr" onsubmit="return confSubmit();" method="post" target="_top">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="SAK96Y5CBTFUL">
    <input type="image" src="http://graphicasylum.com/images/Boton_50_Chico.png" border="0" name="submit" alt="PayPal, la forma más segura y rápida de pagar en línea.">
    <img alt="" border="0" src="https://www.paypalobjects.com/es_XC/i/scr/pixel.gif" width="1" height="1"></a>
    </form>
    </td>
</tr>
    </table>
    </center>

这是我的js代码。

    <script type="text/javascript">// <![CDATA[
    function confSubmit() {
    if(!document.getElementById("accept").checked) {
    alert("Please read and accept the Terms and Conditions in order to continue.");
    return false;
    }
    } // ]]></script>

如果我完全迷失了方向(女巫,我很确定我是),我愿意走另一个方向来实现这一目标!提前感谢您的帮助。:)此外,我不得不把我的2个贝宝按钮放在表格中,因为这是我知道如何将它们并排设置并以网页为中心的唯一方法。

一览。。。

if(!document.getElementById("one").checked) {