0

コーディングに関してはちょっと初心者ですが、誰かが助けてくれることを願っています。2 つのペイパル ボタンを使用して支払いページを設定するように求められました。最初にページに到着したときは、チェックボックスをオンにするまでボタンを無効にする必要があります。これは基本的に、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 つのペイパル ボタンをテーブルに配置する必要がありました。これが、それらを並べて Web ページの中央に配置する方法を知っていた唯一の方法だったからです。

4

1 に答える 1

0

一目で...

if(!document.getElementById("one").checked) {
于 2013-07-16T05:10:33.463 に答える