How do I pass button state and variable onto another page in wordpress?

basviccc

New Member
#1
I've created a wordpress site, and have 4 buttons displaying different $ amounts. I want to save which of those buttons gets selected. When I click the submit button, I want it to use that number.
Mã:
        <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>
This is all I have, and I don't know my next step.
 

Admin

Administrator
Thành viên BQT
#2
What about using an actual form?
Mã:
<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>
Here how you could style it: https://jsbin.com/boxifiguqo/2/edit?html,css,output
 

Từ khóa phổ biến

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top