Community Forums 

Main Content

Radio buttons - help sought

    Nov 14 2015 02:58:06

    #1

    Adam from Tamarisk Farm

    Join date : 2015-11-14      Posts : 5

    I have read and reread numerous posts here about using radio buttons and have tried so many different ideas that I am now hopelessly befuddled and seek help.

    I have a cart set up using addmulti.cfm which works fine to allow a customer to order a chosen number each of various different balls of wool which all cost the same. I am trying to add an additional item - a gift voucher - which I have made just another item on the list with a text box for the number of balls required. This goes through fine and postage is automatically calculated as any other item. I have set up a discount coupon in the admin so that the recipient of the gift voucher can enter the code I send them as payment when they select from the list in due course, and this is already postage paid. So far so good. I want to offer the purchaser of the gift a choice of cards for me to send as the voucher, which will cost 2 (i.e. different from the balls). I want to use radio buttons for this so that only one card can be selected. I can set up the radio buttons ok but I cannot make them send information to the cart. I have tried productpr and product[] but I have not quite undersood the distinction. If I use add.cfm it will send but then i cant use the same submit button for the whole order at once. It also entered the number of cards ordered (i.e. 1) into the box in the cart so the customer could at that stage change it to more than one or delete, which was confusing. I see that I can use a field noqty but Im not clear how. I also tried to write an if statement to only enable the radio buttons after the voucher is selected but failed.

    So to summarise: I want the customer to enter the number of balls required in the text box by Gift Voucher and then be enabled to select from a number of radio buttons beside pictures to choose a card. Id also like the default to be no button checked.

    The link to the existing page is

    http://www.tamariskfarm.co.uk/wool/organic-wool-and-knitting-yarn-online-shop2.html

    where it is set up as Id like it to look but the buttons dont work.

    The recent attempted relevant bit of code is below - in this case I was exploring productpr but I know that is wrong. I am aware that, with a lot of redundant html commented out it is a bit messy and long for which I apologise.

    <form method="POST" action="http://ww6.aitsafe.com/cf/addmulti.cfm"; >

    .
    .
    .
    .

    <tr> <td><hr></td> <td><hr></td> <td><hr></td> </tr>

    <tr align="left" valign="top">
    <td><span style="font-size: 100%;"><h3>Gift Voucher</h3></span></td>
    <td><span style="font-size: 100%;"><b><i></i></b></span></td>
    <td><span style="font-size: 90%;">Number<br>
    of balls</span></td>
    </tr>

    <!-- END OF FIFTH TITLE -->

    <tr align="left" valign="centre">
    <td><img src="Swatches/Knitting1cropped.jpg" width="90" height="60" usemap="#Knitting1cropped" border="0">
    <map name="Knitting1cropped">
    <area shape="rect" coords="0,0,90,60" href="voucher.html" alt="show more" title="Show more details">
    </map></td>
    <td><input type="HIDDEN" name="product19" value="Gift Voucher">
    <input type="HIDDEN" name="price19" value="6.10"> <a href="voucher.html" alt="show more" title="Show more details"><span style="font-size: 100%;">Gift voucher</span></a></td>
    <td><input type="TEXT" name="qty19" size="3"></td>

    <!-- <td><span style="font-size: 60%;"><i>email to confirm<br>
    availability</i></span></td> -->
    </tr>

    <!-- END OF ROW 19 -->

    <tr><td></td><td></td><td><span style="font-size: 90%;">Card choice</span></td></tr>

    <tr align="left" valign="centre">
    <td><img src="Swatches/Jacobs 2015.jpg" width="90" height="60" usemap="#Jacobs 2015" border="0">
    <map name="Jacobs 2015">
    <area shape="rect" coords="0,0,90,60" href="voucher.html" alt="show more" title="Show more details">
    </map></td>
    <td><input type="HIDDEN" name="productpr" value="Gift Voucher - card: 'Jacob with lamb'">
    <input type="HIDDEN" name="price" value="2.00"> <a href="voucher.html" alt="show more" title="Show more details"><span style="font-size: 100%;">Jacob with lamb</span></a></td>
    <td><input type="Radio" name="productpr" size="3" qty="1"></td>


    <!-- <td><span style="font-size: 60%;"><i>email to confirm<br>
    availability</i></span></td> -->
    </tr>

    <!-- END OF ROW 20 -->

    <tr align="left" valign="centre">
    <td><img src="Swatches/DD's.jpg" width="90" height="60" usemap="#DD's" border="0">
    <map name="DD's">
    <area shape="rect" coords="0,0,90,60" href="voucher.html" alt="show more" title="Show more details">
    </map></td>
    <td><input type="HIDDEN" name="productpr" value="Gift Voucher - card: 'Dorset Downs'">
    <input type="HIDDEN" name="price" value="2.00"> <a href="voucher.html" alt="show more" title="Show more details"><span style="font-size: 100%;">Dorset Downs with dog</span></a></td>
    <td><input type="Radio" name="productpr" size="3" qty="1"></td>

    <!-- <td><span style="font-size: 60%;"><i>email to confirm<br>
    availability</i></span></td> -->
    </tr>

    <!-- END OF ROW 21 -->

    <tr align="left" valign="centre">
    <td><img src="Swatches/Shetland twins.jpg" width="90" height="60" usemap="#Shetland twins" border="0">
    <map name="Shetland twins">
    <area shape="rect" coords="0,0,90,60" href="voucher.html" alt="show more" title="Show more details">
    </map></td>
    <td><input type="HIDDEN" name="productpr" value="Gift Voucher - card: 'Shetland Twins'">
    <input type="HIDDEN" name="price" value="2.00"> <a href="voucher.html" alt="show more" title="Show more details"><span style="font-size: 100%;">Shetland twins</span></a></td>

    <td><input type="Radio" name="productpr" size="3" qty="1"></td>

    <!-- <td><span style="font-size: 60%;"><i>email to confirm<br>
    availability</i></span></td> -->
    </tr>

    <!-- END OF ROW 22 -->

    <tr align="left" valign="centre">
    <td><!-- <img src="Swatches/Shetland twins.jpg" width="90" height="60" usemap="#Shetland twins" border="0">
    <map name="Shetland twins">
    <area shape="rect" coords="0,0,90,60" href="voucher.html" alt="show more" title="Show more details">
    </map> --></td>
    <td><input type="HIDDEN" name="productpr" value="Gift Voucher - no card: email only">
    <input type="HIDDEN" name="price" value="0.00"> <a href="voucher.html" alt="show more" title="Show more details"><span style="font-size: 100%;">No card - email only</span></a>


    </td>
    <td><input type="Radio" name="productpr" size="3" qty="1"
    ></td>

    <!-- <td><span style="font-size: 60%;"><i>email to confirm<br>
    availability</i></span></td> -->
    </tr>

    <!-- END OF ROW 23 -->



    <!-- ..................................................................... -->

    </table>
    <input type="HIDDEN" name="userid" value="82398944">
    <!-- <input type="hidden" name="return" value="Ht12869"> -->
    <div align="center"><input type="SUBMIT" value="Add these items to your basket now">
    <input type="hidden" name="return" value="http://www.tamariskfarm.co.uk/wool/organic-wool-and-knitting-yarn-online-shop.html"></div>;
    </form>

    <p></p>


    <form method="POST" action="http://ww6.aitsafe.com/cf/review.cfm"; >
    <p align="center">
    <input type="HIDDEN" name="userid" value="82398944">
    <input type="SUBMIT" value="View basket without adding more yet">
    <input type="hidden" name="return" value="http://www.tamariskfarm.co.uk/wool/organic-wool-and-knitting-yarn-online-shop.html"></p>;
    </form>



    Nov 14 2015 10:59:42

    #2

    GT

    Join date : 2008-09-18      Posts : 3212

    First off, I'd fix the 61 errors in the page:
    https://validator.w3.org/check?uri=http%3A%2F%2Fwww.tamariskfarm.co.uk%2Fwool%2Forganic-wool-and-knitting-yarn-online-shop2.html&charset=%28detect+automatically%29&doctype=Inline&group=0

    Next off, you are not numbering the productpr as in the next product number such as productpr20.

    Productpr does not use a seperate price=, productpr use name of product: <<< colon then the price, then a colon and if you want to the units value, I don't think you've read Mal's help files.

    You have eight uses of productpr...

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

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




    Nov 14 2015 20:11:08

    #3

    Debbie Q

    Join date : 2008-09-18      Posts : 4996

    You have to add your pictures and stuff but how's this?

    <input type="radio" selected name="productpr20" value="">
    <input type="radio" name="productpr20" value="Gift Voucher card- Jacob with lamb:2">
    <input type="radio" name="productpr20" value="Gift Voucher card- Dorset Downs with dog:2">
    <input type="radio" name="productpr20" value="Gift Voucher card- Shetland twins:2">
    <input type="radio" name="productpr20" value="Gift Voucher - No card Email only:0">
    <input type="hidden" name="qty20" value="1">

    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.




    Nov 15 2015 23:57:56

    #4

    Adam from Tamarisk Farm

    Join date : 2015-11-14      Posts : 5

    Thank you both for responses. Using both your suggestions I have cracked it.

    Particularly helpful was the example forms at Mal's Forms. I am working through the list of errors, most of which seem to be "spelling mistakes`' as it were, such as the omission of a closing tag, but what I don't understand is how the HTML works with so many little syntax and typo errors?

    The other problems, which are more about making it tidy and the satisfaction of getting the detail right, are to make the card choice buttons conditional on having first selected the gift voucher, and that the cart shows the options as "1" quantity in an editable text box which is potentially confusing as it is only posible to buy these in singel units. I don't mind not fixing these but I feel as though I should know how to.

    Adam



    Nov 16 2015 00:28:53

    #5

    Debbie Q

    Join date : 2008-09-18      Posts : 4996

    I don't know a way to make it required to purchase a gift voucher before they purchase the card. You probably need a script to hide it or something but I am not sure why anyone would want to buy a blank card anyway.

    But the other problem... You can do this using a field named "noqty20" in your code. There are three possible values:

    noqty=1 the cart displays the number as text
    noqty=2 displays a checkbox so the item can still be deleted
    noqty=3 displays a checkbox and a quantity in text

    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.




    Nov 17 2015 20:30:43

    #6

    Alan

    Join date : 2008-09-18      Posts : 2956

    Some browsers are more tolerant of html errors than others. But you don't know which browsers at which levels your customers use. Or how long they will all continue to tolerate a specific error.

    So it's best to clean up code, even when it appears to work.

    Alan
    Some shipping help documents are available at www.stoner.org.uk/mals/




    Nov 17 2015 22:15:12

    #7

    Adam from Tamarisk Farm

    Join date : 2015-11-14      Posts : 5

    Thanks to all - I've pretty much sorted it now.