Community Forums 

Main Content

Need help with radio button selection

    Feb 07 2011 19:23:05

    #1

    Evolving Door

    Join date : 2011-01-29      Posts : 21

    I have an order page that uses only checkboxes that works fine. I'm trying to streamline the ordering process by using radio buttons for selections that are mutually exclusive (one only) but I can't get this to pass the order to the cart.

    I'm using Paypal Standard as my payment method.

    Here's a link to the test form where I'm just trying to get one radio button input form (with 3 choices) to work:

    http://www.evolvingdoor.ca/marketplace/testform.htm

    Any help would be greatly appreciated! :-)

    Wendy



    Feb 07 2011 21:10:27

    #2

    Alan

    Join date : 2008-09-18      Posts : 2987

    How about having 3 x productpr1 as your selection, and including the date section once. On these lines.


    <input type="radio" name="productpr1" value="3 month:24.95" />
    <input type="radio" name="productpr1" value="6 month:29.95" />
    <input type="radio" name="productpr1" value="12 month:34.95" />

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




    Feb 07 2011 22:49:51

    #3

    Evolving Door

    Join date : 2011-01-29      Posts : 21

    Thanks for your suggestion, Alan. Unfortunately it still isn't passing the order information to the cart. I've tried a few other things, and found that if I use different variables for each radio item (e.g. Qty1/Product1/etc for first item, Qty2/Product2/etc for second item, and so on), it does pass the information to the cart.

    However, when I include other checkbox items below it, it only works some of the time. If I select the second or third in the radio button series, along with a checkbox item, it passes all items correctly. But if I select the first radio item and one or more of the checkbox items below, the radio item does not get passed. There's no difference in the codes that I can see, other than the variable numbers, but if that was the problem then it would do the same for the other radio items too. It only happens with the first radio item.

    I've updated the sample page in my link above so that you can see for yourself what's happening. Any help would be most appreciated. Thanks!

    Wendy



    Feb 08 2011 05:29:28

    #4

    Alan

    Join date : 2008-09-18      Posts : 2987

    All three on my page worked - I do have qty1 with a value of 1.

    There are no qty defaults with addmulti.cfm - so I'm not clear why any work for you unless your script provides the quantity - in which case I'd be looking there.

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




    Feb 08 2011 06:33:14

    #5

    Evolving Door

    Join date : 2011-01-29      Posts : 21

    Thanks again Alan. The Qty variables are assigned in the javascript -- which gave me the idea of why the first one wasn't working for me. The problem was in my javascript, since Qty1/etc have a special function in my page and are used to pass information about the person ordering (that can't be collected reliably any other way). I didn't include it in the test form because it takes forever to fill out, just for testing.

    The javascript didn't include Qty1 (it only deals with the priced items), so indirectly you pointed me to the answer. Thanks! I've got the test form to work now.

    I might be back if I can't get something else to work, but in the meantime, this has been resolved. Many thanks! :-)

    Wendy



    Feb 08 2011 06:37:13

    #6

    GT

    Join date : 2008-09-18      Posts : 3256

    Drop the running total script Wendy.

    Use a dropdown as the first selection rather than radio buttons, then checkboxes for the add-ons.

    http://www.tne.co.uk/mals/dropdowns-2-plus-tickbox.html

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

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




    Feb 08 2011 07:19:37

    #7

    Evolving Door

    Join date : 2011-01-29      Posts : 21

    Hi GT, thanks for your suggestions. The test form I have up there is actually a very diluted version of the current page and an even more diluted version of the page I'm creating. I'm adding a bunch of products to the order page and wanted to streamline the ordering and input process while I was at it.

    I could use a dropdown for the mutually exclusive items, I suppose. The thing is, there's another set of data that the user can (optionally) select, which is the start date of the report they're ordering. It defaults to the date of order, but if the user prefers a different start date they can select the day, month and year.

    Currently, the start date (if used) is given separately for each item, using 3 dropdown lists, for day, month and year. Then the code just concatenates the day, month and year to the corresponding Product field string. If the date isn't selected, one of the default date values passes "today" to the Product string.

    There are several reports to choose from. Some of the reports can be run for 3 months, 6 months or 12 months, the choice of which inputs the price for the option selected.

    What I would like to do is present just one date input area for each report. In other words, if the user wants to buy that report, they would choose 3, 6 or 12 months (which inputs the price). Then, if they wanted to specify the start date, they would select from just one set of date fields for that report, from which to select the start date.

    The trick is to know which Product field number to assign the date string to, which can't be known until the user selects the report length (assuming they want to select that report at all).

    I'm not sure if this could be done with the example you've indicated. I just looked at the page source and was very surprised to see that it combines Productpr1 with Product1[]. (!) I didn't think you could use them together. I'll have to try this and see if it would work for me. It might solve a lot of problems, if it does. I'll have to try this tomorrow though, as it's way past my bedtime here. :-)

    By the way, is that your own site? It looks familiar and I think I may have used it extensively when I first put the current page together a few years ago. As I recall, it was a huge help! But I still had to create my own routines, since there wasn't a single script at that time that did what I needed it to do (or at least not one that seemed like it would do the trick).

    I'll let you know tomorrow how I make out. :-) Thanks!

    Wendy



    Feb 08 2011 12:36:03

    #8

    GT

    Join date : 2008-09-18      Posts : 3256

    If you're using a date, are you using this in your form?
    http://www.tne.co.uk/mals/calender.html

    Have you considered using hidden divs for the report choice and date that goes with that report?

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

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




    Feb 08 2011 18:46:43

    #9

    Evolving Door

    Join date : 2011-01-29      Posts : 21

    GT said If you're using a date, are you using this in your form?
    http://www.tne.co.uk/mals/calender.html

    Have you considered using hidden divs for the report choice and date that goes with that report?


    I'm not sure what you mean about using hidden divs. Can you say more?

    The JS calendar is wonderful! I would love to use something like that. I noticed that part of the terms of use, though, was not to use it for commercial purposes. Clearly this is for a commercial purpose, as most uses of Mal's cart would be, so that's a bit confusing. Is this your own website?



    Feb 09 2011 05:28:34

    #10

    GT

    Join date : 2008-09-18      Posts : 3256

    I gave the date selector as an example, there are free ones out there, do a search.

    Here's an example of using hidden divs:
    http://www.tne.co.uk/mals/multi-dropdown.html

    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      »