【问题标题】:Enabling PayPal buttons with a checkbox启用带有复选框的 PayPal 按钮
【发布时间】:2013-07-13 11:47:11
【问题描述】:

在编码方面我有点菜鸟,但就这样吧,希望有人能提供帮助。我被要求使用两个贝宝按钮设置支付页面。当您第一次到达页面时,需要禁用按钮,直到他们选中复选框,这基本上意味着他们已经接受了 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 个 paypal 按钮放在表格中,因为这是我知道如何将它们并排设置并以网页为中心的唯一方法。

【问题讨论】:

    标签: javascript html checkbox paypal payment


    【解决方案1】:

    一目了然...

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

    【讨论】:

    • 是的,我已经尝试过了,但是无论是否选中复选框,PayPal 按钮仍然有效。
    猜你喜欢
    • 2021-08-21
    • 2015-11-12
    • 1970-01-01
    • 1970-01-01
    • 2017-10-19
    • 1970-01-01
    • 2015-12-09
    • 2016-12-11
    • 1970-01-01
    相关资源
    最近更新 更多