Community Forums 

Main Content

All items posting to order page

    Mar 26 2010 04:38:09

    #1

    belindaj

    Join date : 2008-09-18      Posts : 6

    Can't figure out what I'm doing wrong - I want each line item to be able to be added to a cart - but no matter if I select one line item or all of them - they ALL post to the cart. I'm sure it's something simple?

    http://mccga.org/directors-test.htm



    Mar 26 2010 05:20:01

    #2

    Debbie Q

    Join date : 2008-09-18      Posts : 4999

    You are using an addmulti form but you have a button for each line. Addmulti adds all products with one click.

    If you are going to have a submit button for each line then each line has to start with a form method and end with a </form> after the button. Your form method should be add.cfm and you would not need product numbers.

    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.




    Mar 26 2010 13:13:12

    #3

    belindaj

    Join date : 2008-09-18      Posts : 6

    Thanks Debbie - but on your example here (http://www.tne.co.uk/mals/multiple-2.html) - it is using addmulti.

    I changed it to add, and added the form method (and the /form at the end) to each line, but then when I tested it - I got errors of price syntax not set (although it was, on each item, the only thing I changed was to add the form statement to each item).

    I changed it back to addmulti on each line, and now it works.

    After sleeping on it overnight - I still need to simplify the form more - it's confusing - but then that's not a MALS problem! Thanks for your help!



    Mar 26 2010 14:34:44

    #4

    GT

    Join date : 2008-09-18      Posts : 3249

    The page is a bit of a mess Belinda, you've put forms inside a table, plus a load of other errors:
    http://validator.w3.org/check?uri=http://mccga.org/directors-test.htm

    The structure should be:
    <form>
    <table>
    <tr>
    <td>
    <input items....>
    </td>
    </tr>
    </table>
    </form>

    You're using addmulti for single products.

    I'd change:
    <option value="--select--">
    to
    <option value="">
    that will prevent anything showing in the cart as nothing has been selected.

    hih.

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

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