Community Forums 

Main Content

Using productpr with Radio Buttons

    Dec 10 2013 20:58:47

    #1

    paul_richardson

    Join date : 2008-10-04      Posts : 70

    I have a form which uses productpr with a dropdown to choose one of two possible (different priced) options.

    I would like to use radio buttons instead, but can't figure out the form.

    Can anyone point me in the right direction?

    Regards,

    Paul



    Dec 10 2013 22:50:30

    #2

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    <input type="radio" checked name="productpr" value="item 1, :12.97">

    <input type="radio" name="productpr" value="item 2, :15.97">

    Debbie Q

    Mal's Support: www.mals-e.com/support.php
    GT's Forms and examples: www.malsforms.com
    Helpful java scripts: www.gemasana.com/mals
    Shipping help documents: www.stoner.org.uk/mals

    My Create-A-Book Publishing - mycreateabook.com
    Personalized Books, Music CDs and Gifts for all ages and occasions.

    Please help me out and share my site on your networks.




    Dec 11 2013 13:23:03

    #3

    paul_richardson

    Join date : 2008-10-04      Posts : 70

    Hi Debbie,

    Many thanks for your quick and accurate reply to my request.

    As usual, your are spot on, and the syntax you gave works perfectly.

    Unfortunately, as usual, I am asking the wrong question, as the radio buttons still don't achieve what I'm looking for.

    One of our products is a range of aperture panels, which have optional templates.

    (as you can see here) http://www.craftee.co.uk/xaperturepanels01.php

    At the moment, It is possible to buy the template, without buying the aperture panel, but that is not what we want to happen.

    The template is only supposed to be available if you buy the panel.

    Try as I may, I can't figure this one out.

    If you need the full form, I have listed it below.

    Regards,

    Paul

    <form action="http://ww5.aitsafe.com/cf/addmulti.cfm"; method="post">
    <input type="hidden" name="return" value="www.craftee.co.uk/xaperturepanels01.php#ap304">;
    <input type="hidden" name="userid" value="78209165">
    <input type="hidden" name="product1[]" value="AP304, Bethlehem Star, Aperture Panels">
    <input type="hidden" name="price1" value="0.99">
    <input type="hidden" name="nocart">
    <input name="qty1" size="2" type="text">
    Enter Quantity<br>
    <select name="product1[]">
    <option value="White" selected>Select Colour</option>
    <option value="White">White</option>
    <option value="Ivory">Ivory</option>
    <option value="Cream">Cream</option>
    <option value="Grey">Grey</option>
    <option value="Black">Black</option>
    <option value="Burgundy">Burgundy</option>
    <option value="Terracotta">Terracotta</option>
    <option value="Red">Red</option>
    <option value="Peach">Peach</option>
    <option value="Yellow">Yellow</option>
    <option value="Lemon">Lemon</option>
    <option value="Mint Green">Mint Green</option>
    <option value="Bright Green">Bright Green</option>
    <option value="Dark Green">Dark Green</option>
    <option value="Forest Green">Forest Green</option>
    <option value="Pale Blue">Pale Blue</option>
    <option value="Bright Blue">Bright Blue</option>
    <option value="Cobalt Blue">Cobalt Blue</option>
    <option value="Navy Blue">Navy Blue</option>
    <option value="Purple">Purple</option>
    <option value="Orchid">Orchid</option>
    <option value="Lilac">Lilac</option>
    <option value="Cerise Pink">Cerise Pink</option>
    <option value="Pale Pink">Pale Pink</option>
    </select>
    <br>
    <input type="radio" name="productpr2" value="IFT304 Template:0.99">
    <font size="2">Add Template for 99p</font>
    <input type="hidden" name="qty2" value=1>
    <br>
    <input type="submit" value="Buy Now!">
    <br>
    </form>



    Dec 11 2013 15:53:05

    #4

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    If the person buys multiple panels do they want the same number of templates? If so the soultion is easy. Would have to give some thought to it if they only need one template.

    Debbie Q

    Mal's Support: www.mals-e.com/support.php
    GT's Forms and examples: www.malsforms.com
    Helpful java scripts: www.gemasana.com/mals
    Shipping help documents: www.stoner.org.uk/mals

    My Create-A-Book Publishing - mycreateabook.com
    Personalized Books, Music CDs and Gifts for all ages and occasions.

    Please help me out and share my site on your networks.




    Dec 11 2013 16:34:00

    #5

    paul_richardson

    Join date : 2008-10-04      Posts : 70

    Hi Debbie,

    They would only need 1 template, regardless of how many panels they buy.

    I figured it was tricky to achieve.

    I've been trying loads of different things but the one that's live at the moment is the best I could come up with.

    Regards,

    Paul



    Dec 12 2013 04:49:39

    #6

    GT

    Join date : 2008-09-18      Posts : 3207

    If the qty1 value is zero, the qty2 value cannot be passed to Mal's is what I'm guessing you're wanting...

    Then add this to the opening form line...
    onsubmit="if(this.qty1.value<1){alert('Please enter the quantity of aperture panels required');this.qty1;return false;}"

    By the way, I would look at fixing the page errors:
    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.craftee.co.uk%2Fxaperturepanels01.php

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.




    Dec 13 2013 07:43:09

    #7

    paul_richardson

    Join date : 2008-10-04      Posts : 70

    GT said If the qty1 value is zero, the qty2 value cannot be passed to Mal's is what I'm guessing you're wanting...

    Then add this to the opening form line...
    onsubmit="if(this.qty1.value<1){alert('Please enter the quantity of aperture panels required');this.qty1;return false;}"

    By the way, I would look at fixing the page errors:
    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.craftee.co.uk%2Fxaperturepanels01.php


    Hi GT,

    Many thanks for the Solution to my problem, it works a treat, I have implemented it on the first product on the page, and will be putting on the rest, when my wife (the boss) has agreed the message wording.

    I have had a look at (and fixed a few) of the errors and warnings shown up by the WC3 validator but I am struggling with the remainder.

    The only warning which is left:- Line 61, Column 77: relates to what I believe to be the correct implementation of Mal,s view cart with a return. I have no idea why that gets picked up. It also generates 2 errors (which follow it) and an information line.

    All the remaining errors appear to related to my CSS menu and my return to top of page script. Both of which I downloaded (I think from Dynamic Drive).

    I don't really know HTML, I use Dreamweaver to create the pages and muddle my way from there, so I have no idea why WC3 doesn't like my menu or return to top.

    The only thing I do know is that they both "appear" to work. I test using IE, Opera and Firefox.

    Thanks again for your Help.

    Regards,

    Paul



    Dec 13 2013 09:43:15

    #8

    GT

    Join date : 2008-09-18      Posts : 3207

    I see 47 errors currently on the page:
    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.craftee.co.uk%2Fxaperturepanels01.php

    The return error is due to you using & and not &amp;

    Replace all instances of that, then check.

    Line 23, remove the <link rel="stylesheet" type="text/css" href="craftee.css" /> forward slash and space at the end of the line.

    You are using HTML5 declaration, yet that line is XHTML markup.

    Lines 56-63 you have added a ; in the string after the "menulink", remove it from those lines:

    <td><a href="xoccasions.html" class="menulink"; title="Back to Christmas">Back</a></td>
    <td><a href="aperturecards.html" class="menulink"; title="Back to Aperture Cards">Back</a></td>
    <td><a href="allaboutus.html" class="menulink"; title="Click Here to learn more about CRAFTEE">About Us</a></td>
    <td><a href="help.html" class="menulink"; title="If you need help just click Here!">HELP !!</a></td>
    <td><a href="http://ww5.aitsafe.com/cf/review.cfm?userid=78209165&return=www.craftee.co.uk/xaperturepanels01.php"; class="menulink"; title="Click Here to view your Cart Contents, or to Check Out">Cart</a></td>
    <td><a href="contact.html" class="menulink"; title="Click Here for our Contact Information">Contact</a></td>
    <td><a href="search.html" class="menulink"; title="Click Here to Search our Web Site for Card Making Supplies">Search</a></td>
    <td><a href="index.html" class="menulink"; title="Click Here to return to our Home Page">Home</a></td>

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.




    Dec 13 2013 10:33:58

    #9

    paul_richardson

    Join date : 2008-10-04      Posts : 70

    Hi GT,

    Thanks for all of that.

    Silly me I've been working on a different page with an almost identical URL

    http://www.craftee.co.uk/aperturepanels01.php

    If you check that one, you will see that I've fixed quite a few of the errors and with your further comments I can now start the long job of fixing the problems in my 200 odd pages.

    Regards,

    Paul



    Dec 13 2013 12:04:44

    #10

    GT

    Join date : 2008-09-18      Posts : 3207

    If faults are common across the site, do a global search and replace, 10 second job Paul.

    I see you're really struggling in search engines...

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.




       1   |   2      »