Community Forums 

Main Content

form with lots oif text boxes & drop downs. help needed

    Apr 15 2013 04:27:52

    #1

    Claire

    Join date : 2008-11-08      Posts : 90

    Hello!

    I'm working on this form
    http://www.outdoortrailgear.com/co-op-details/custom-weightbelt.html

    ignore the upper half above the dashed line. The whole form is a test form - but being sent to live cart. continue shopping will bring you back to test form.

    Under the dashed line select the following;
    Size,
    Select # of Lines of Embroidery: choose 1 line of embroidery
    SKIP the option, "Height of Embroidery"
    then under, "Choosing font styles & Colors" fill in stuff for the first line.
    then add to cart.

    when I do this I get 3 extra items added to the cart - that just shows comma's ,,

    which tells me other items are being added that weren't selected.

    Anyone have a solution for this?

    It works fine if I fill out all options. but its not required to fill in all options. A user can choose only 1 or 2 lines of embroidery.

    Thanks in advance!

    ----
    Claire Walters Design Studios




    Apr 15 2013 05:40:47

    #2

    GT

    Join date : 2008-09-18      Posts : 3207

    Hi Clair,

    Here, you have a qty, but no price to go with it:
    <input type="hidden" name="qty4" value="1">
    Use this option if you chose 3 lines of embroidery: <select name="product4">

    With the others, where you have a qty value of one, the item is added to the cart, but your first select is left empty when using productpr, so no product name/price is sent:
    <select name="productpr9" id="Font on Tongue">
    <option></option>

    To force a buyer to make a selection, I suggest you look at this page:
    http://www.malsforms.com/force-selection.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.




    Apr 15 2013 05:44:55

    #3

    Claire

    Join date : 2008-11-08      Posts : 90

    Hey GT - thx for reply.

    no price is needed for the qty4

    I do have <option></option>

    I have tested several times. when I remove text boxes I don't get extra items added to cart with commas. the culprit is the text boxes sending an empty item to cart

    thoughts?




    GT said Hi Clair,

    Here, you have a qty, but no price to go with it:
    <input type="hidden" name="qty4" value="1">
    Use this option if you chose 3 lines of embroidery: <select name="product4">

    With the others, where you have a qty value of one, the item is added to the cart, but your first select is left empty when using productpr, so no product name/price is sent:
    <select name="productpr9" id="Font on Tongue">
    <option></option>

    To force a buyer to make a selection, I suggest you look at this page:
    http://www.malsforms.com/force-selection.html

    ----
    Claire Walters Design Studios




    Apr 15 2013 05:50:00

    #4

    Claire

    Join date : 2008-11-08      Posts : 90

    here's same form without text boxes.

    http://www.outdoortrailgear.com/co-op-details/weightbelt-no-text-boxes.html

    it will not add the empty items to cart.

    ----
    Claire Walters Design Studios




    Apr 15 2013 06:14:24

    #5

    Claire

    Join date : 2008-11-08      Posts : 90

    so my question now is - if user does not enter text in text box - is there anyway to tell cart not to send empty product to cart?

    ----
    Claire Walters Design Studios




    Apr 15 2013 06:32:15

    #6

    Alan

    Join date : 2008-09-18      Posts : 2951

    If you have a product and a qty a line will be added to the cart.

    If something is free, don't create a new product; make the text an option on an existing product.

    General rules on commas seem to be that 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, as an entity.

    To avoid one after a text box

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

    But it's messy in that the customer may spot the added comma in the text box as he completes the form.

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




    Apr 15 2013 12:34:05

    #7

    Claire

    Join date : 2008-11-08      Posts : 90

    When qty is in a line with <option ></option > the item does not get added to the cart - only when the user selects it. That is good in this case. Like in this sample. try this sample, select a size and fill in option #2 only then add to cart. No extra items are added.
    http://www.outdoortrailgear.com/co-op-details/weightbelt-no-text-boxes.html

    But this is the form I want to use. Try this one. Select size and fill in option #2 only. Then add to cart. You will see blank items sent to cart. This is caused by the text boxes.
    http://www.outdoortrailgear.com/co-op-details/custom-weightbelt.html

    My question. If user does not choose option with text boxes - any way to stop it from sending a blank item to cart? Am I doing text boxes correctly? Is there something I can do different to get the same result?

    Thank you!

    Alan said If you have a product and a qty a line will be added to the cart.

    If something is free, don't create a new product; make the text an option on an existing product.

    General rules on commas seem to be that 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, as an entity.

    To avoid one after a text box

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

    But it's messy in that the customer may spot the added comma in the text box as he completes the form.

    ----
    Claire Walters Design Studios




    Apr 15 2013 12:40:54

    #8

    Claire

    Join date : 2008-11-08      Posts : 90

    I should add I know I can use check boxes next to the options and blank items will not be added- only the item the user checks will be added. I was hoping not to use check boxes and use that form as is.

    Thanks! :-)

    ----
    Claire Walters Design Studios




    Apr 15 2013 14:01:57

    #9

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    I believe GT has a price option script available that might help with your problem. Check his form page below.

    You could make the color of your second line of text a different product number and use productpr.

    <input type="hidden" name="qty6" value="1">
    Select Font Style Line #2: <select name="productpr6" id="font-line2">
    <option></option>
    <option value="Font Line 2-Block-:00.00:0">Block</option>
    <option value="Font Line 2-Script-:00.00:0">Script</option>
    <option value="Font Line 2-Full-Block-:00.00:0">Full Block</option>
    <option value="Font Line 2-Full Block Outlined-:00.00:0">Full Block Outlined</option>
    <option value="Font Line 2-2-Tone-Full Block-:5.00:0">2 Tone Full Block</option>
    </select>
    <br>Thread color line 2<select name="productpr7" size="1">
    <option selected value=""></option>
    <option value="Red, :0">Red</option>
    <option value="Blue, :0">Blue</option>
    <option value="Green, :0">Green</option>
    </select>
    <br>Text for Line 2: <input name="product7[]" type="text" size="20">

    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.




    Apr 15 2013 15:08:27

    #10

    Alan

    Join date : 2008-09-18      Posts : 2951

    You can set the qty to 0 and change it to 1 if the product is selected. Using part of your form, if I don't select the product, nothing goes to the cart, even if I enter text.

    If I do select the product then because the non-chargeable items are not new products, they go to the cart as text (if any) and commas. I described earlier how to remove commas if wished.

    <form action="http://ww1.aitsafe.com/cf/addmulti.cfm"; method="post" id="qtys" name="qtys"><input name="userid" value="3846922" type="hidden">
    <p>
    Complete options below for each line of embroidery you are ordering<br>
    <input name="qty5" value="0" type="hidden">
    Select Font Style Line #1: <select name="productpr5" font-line1="" onChange='document.qtys.qty5.value="1"' >

    <option selected="selected"></option>
    <option value="Font Line 1-Block-:00.00:0">Block</option>
    <option value="Font Line 1-Script-:00.00:0">Script</option>
    <option value="Font Line 1-Full-Block-:00.00:0">Full Block</option>
    <option value="Font Line 1-Full Block Outlined-:00.00:0">Full Block Outlined</option>
    <option value="Font Line 1-2-Tone-Full Block-:5.00:0">2 Tone Full Block</option>
    </select>

    <br>Text for Line 1: <input name="product5[]" size="20" type="text">
    <br>Thread color Line 1:<input name="product5[]" size="20" type="text"><br>
    *if you chose 2-Tone font for line 1, The field above is for the inside color, the field below is for the outline color.<br>
    Line1-2nd color/outline for 2-tone Full Block Only:<input name="product5[]" size="20" type="text">
    <P>
    <input name="submit" type="submit" value="Add to Cart"></form>

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




       1   |   2      »