• Hi,

    I implemented a dropdown menu where the user chooses which organization s/he wants to donate to. How do I do the same but using radio buttons instead?

    This is the code I tried but it’s not working:


    // Add radio buttons for donation purposes
    function paypal_purpose( $purpose ) {
    return '
    <input type="radio" name="Donate" value="Donation to Org 1" checked>Donate to Org 1
    <input type="radio" name="Donate" value="Donation to Org 2">Donate to Org 2
    <input type="radio" name="Donate" value="Donation to Org 3r">Org 3
    ';
    }
    add_filter( 'paypal_donations_purpose_html', 'paypal_purpose' );

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, can can you share the dropdown code you used that works?

    Thank you

    Thread Starter xorbal

    (@xorbal)

    Hi, here’s the code for the dropdown that works:


    // Add a drop down menu for donation purposes
    function paypal_purpose( $purpose ) {
    return '
    <select name="item_name">
    <option value="Donation to Org 1">Donate to Org 1</option>
    <option value="Donation to Org 2">Donate to Org 2</option>
    <option value="Donation to Org 3">Donate to Org 3</option>
    </select>
    ';
    }
    add_filter( 'paypal_donations_purpose_html', 'paypal_purpose' );

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Help using radio buttons’ is closed to new replies.