如何将按钮状态和变量传递到wordpress中的另一个页面?

问题描述 投票:-5回答:1

我创建了一个wordpress网站,有4个按钮显示不同的金额。我想保存哪些按钮被选中。当我单击提交按钮时,我希望它使用该数字。

        <h2>Amount   </h2>      
        <a href="#" role="button">
                    $51.00
                </a>
        <a href="#" role="button">
                    $110.00
                </a>
        <a href="#" role="button">
                    $65.00
                </a>
        <a href="#" role="button">
                    $278.00
                </a>
        <a href="#" role="button">
                    Submit
                </a>

这就是我的全部,我不知道我的下一步。

jquery html css wordpress shopping-cart
1个回答
1
投票

使用实际表格怎么样?

<h2>Amount</h2>

<form action="" method="get">


    <input id="51" type="radio" name="amount" value="51">

    <label for="51">$51.00</label>


    <input id="110" type="radio" name="amount" value="110">

    <label for="110">$110.00</label>


    <input id="65" type="radio" name="amount" value="65">

    <label for="65">$65.00</label>


    <input id="278" type="radio" name="amount" value="278">

    <label for="278">$278.00</label>



    <input type="submit">


</form>

在这里你可以如何设计它:https://jsbin.com/boxifiguqo/2/edit?html,css,output

© www.soinside.com 2019 - 2024. All rights reserved.