Community Forums 

Main Content

New line in cart after text area

    May 05 2014 19:29:52

    #1

    Flaggfish

    Join date : 2008-09-23      Posts : 77

    I'm using {br} , as in
    <input type="radio" name="product[2]" value="Cranberry{br} ," />Cranberry
    to get the cart to go to a new line after that entry.

    How do I get the same thing after a text area like
    <input type="hidden" name="product[15]"><textarea cols="30" rows="1" name="product[15]">


    Here's the example of the comma after the 12:39:

    QTY PRODUCT PRICE AMOUNT
    1 Tradiional Stocking, Sleigh/Bells
    Kelly
    Knit Name, test12:39,
    Ship to me
    ___________
    What am I doing wrong?



    May 05 2014 19:51:01

    #2

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    Use a hidden field. <input type="hidden" name="product[]" value="{br} ," /> or put the {br} before the value of the next field.

    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.




    May 20 2014 16:56:11

    #3

    Flaggfish

    Join date : 2008-09-23      Posts : 77

    I have been able to use line breaks successfully with radio buttons, but I'm getting some commas when I try the code with a text area. Here's one that still has a comma:
    <input type="hidden" name="product[15]"><textarea cols="30" rows="1" name="product[15]"></textarea>
    <input type="hidden" name="product[30]" value="{br} ," />

    Any ideas what I'm doing wrong?
    Here's my test page where I'm working out the bugs:
    http://www.specialtiesinwool.com/traditional-stockings-test-page.html



    May 20 2014 18:31:21

    #4

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    Try this... <input type="text" name="product[]" size="20" id="thisone" onChange="thisone.value = thisone.value+','">

    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.




    May 20 2014 22:00:01

    #5

    Flaggfish

    Join date : 2008-09-23      Posts : 77

    Just to be clear, the text area does not have a $ value in it. It's just a name for personalization. Will this still work? This is a new kind of code for me..

    Would I still need after what you gave me?
    <input type="hidden" name="product[30]" value="{br} ," />



    May 21 2014 00:12:02

    #6

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    yes, I believe you still use the hidden break line.

    <input type="text" name="product[]" size="20" id="thisone" onChange="thisone.value = thisone.value+','">
    <input type="hidden" name="product[]" value="{br} ," />

    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.




    May 21 2014 11:31:23

    #7

    Flaggfish

    Join date : 2008-09-23      Posts : 77

    I'm still getting commas. The breaks are happening but I need to get rid of the commas because sometimes people don't need to fill in the address lines and it shows as a row of commas.
    Here's the address section:
    <input type="text" name="product[37]" size="20" id="thisone" onChange="thisone.value = thisone.value+','">
    <input type="hidden" name="product[]" value="{br} ," />
    <br />
    Street or PO&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="text" name="product[38]" size="20" id="thisone" onChange="thisone.value = thisone.value+','">
    <input type="hidden" name="product[]" value="{br} ," />
    <br />
    City, State, Zip
    <input type="text" name="product[39]" size="20" id="thisone" onChange="thisone.value = thisone.value+','">
    <input type="hidden" name="product[]" value="{br} ," />

    <br />

    If this is a gift, add your gift message here and we will hand write a card:
    <input type="text" name="product[40]" size="20" id="thisone" onChange="thisone.value = thisone.value+','">
    <input type="hidden" name="product[]" value="{br} ," />



    May 21 2014 13:25:26

    #8

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    A comma is placed after every entry. A comma cancels out a comma. You will need to play with it using different options. You can try putting the break and/ comma before a field. Or after or both. Sometimes it can take time to figure out what will work with all of your possiblities. Trial and error is what I do.

    One thing to consider is do you REALLY want the info broke apart into so many lines in the cart? It looks nice but If someone wants to purchase multiple stockings The cart might run out of space.

    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.




    May 21 2014 17:11:13

    #9

    Alan

    Join date : 2008-09-18      Posts : 2949

    When I last looked the logic was

    The cart adds a comma BEFORE a second or subsequent product[] value UNLESS the previous value ended with a comma.

    So you can put commas in all but the last value. Treat a set, such as the drop down list, as an entity.

    To avoid one after a text box

    <input type="text" name="product[]" value="" id="thisone" onChange="thisone.value = thisone.value+','" />

    but there's the possibility this might confuse the customer who may notice the comma.

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




    May 22 2014 12:24:33

    #10

    Flaggfish

    Join date : 2008-09-23      Posts : 77

    Thanks folks, I'll continue to play with it. I appreciate your input. I've also asked Mal.



       1   |   2      »