WordPress.org

Ready to get started?Download WordPress

Forums

Simple Fields
Radio Button Installation (4 posts)

  1. rpravder
    Member
    Posted 1 year ago #

    I am trying to use Simple Fields to take the results from the radio button selection in html into a shopping cart URL. I went through tutorial 1 with no difficulty. However, I cannot figure out from tutorial 2 how to set a variable using HTML forms (input type="radio" name="qty" value="1") and pull the user's selection into a variable I can pass to a URL I don't mean to ask such a basic question, but I am stuck at this step. Thank you.

    http://wordpress.org/extend/plugins/simple-fields/

  2. Pär Thernström
    Member
    Plugin Author

    Posted 1 year ago #

    Can you give a code example/snippet of what you're trying to do?

  3. rpravder
    Member
    Posted 1 year ago #

    The following code creates a radio button and tries to use <form action=..." to attach the results of the radio button to the [value] field in a URL that invokes the shopping cart. I also left the <a>command where the button is actually clicked which does the same thing. This is the first time I have tried to transfer variables from a form to a button to the shopping cart URL, so I am still unclear of how this is supposed to work.

    ------------

    <div class="top-3">
    
    <form action="http://secure.ourshoppingcarturl.com?Quantity=[value]" method="get">
    		<p class="offer"><input type="radio" name="qty" value="1" /><strong>Qty 1 (15 day supply). <span class="color-red">$39</span></strong> + Shipping</p>
    		<p class="offer"><input type="radio" name="qty" value="3" /><strong>Qty 3 (45 day supply). <span class="color-red">$108</span></strong>  FREE shipping. SAVE 15%</p>
    		<p class="offer"><input type="radio" name="qty" value="6" /><strong>Qty 6 (90 day supply). <span class="color-red">$198</span></strong>  FREE shipping. SAVE 19%</p>
    		</form>
    
    			<div><a href="http://secure.ourshoppingcarturl.com?Quantity=[value]" /><strong><em>Add to Cart</em></strong></a>
    
    </div>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  4. rpravder
    Member
    Posted 1 year ago #

    This is the add to cart button. somehow, it didn't come through on the above post.

    <div><a href="secure.ourshoppingcart.com?Quantity=[value]" /><strong><em>Add to Cart</em></strong>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic