Community Forums 

Main Content

Multi add to cart with just a Qty of 1 showing

    Jul 22 2013 19:18:29

    #1

    Don

    Join date : 2008-09-18      Posts : 487

    Hi,

    I am struggling to work this form out, I need to add all the text boxes & 2 Radio buttons to the shopping cart, all showing on separate rows but with only a quantity of 1.

    I already have validation set up and working OK.

    Any help is most appreciated.

    <form action="http://ww11.aitsafe.com/cf/addmulti.cfm"; method="post" name="form1" id="form1">
    <input name="userid" type="hidden" value="D******">
    <input type="hidden" name="return" value="www.donbarrow.co.uk/rally_books.html">;
    <input type="hidden" name="price1" value="60.00">
    <table>
    <tr>
    <td><p align="right">Nominated First Name</p></td>
    <td><input type="text" name="product1[]" size="20" id="Name1" value="">
    <input type="hidden" name="qty1" value="1">

    <INPUT TYPE="HIDDEN" NAME="nocart">
    </td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Nominated Last Name</p></td>
    <td><input type="text" name="product2[]" size="20" id="Name2" value="">
    <input type="hidden" name="qty2" value="1">
    <input type="hidden" name="price2" value="0">
    <INPUT TYPE="HIDDEN" NAME="nocart"></td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Email Address Address</p></td>
    <td><input type="text" name="product3[]" size="20" id="Email3" value="">
    <input type="hidden" name="qty3" value="1">
    <input type="hidden" name="price3" value="0">
    <INPUT TYPE="HIDDEN" NAME="nocart"></td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Tel No</p></td>
    <td><input type="text" name="product4[]" size="20" id="Telephone4" value="">
    <input type="hidden" name="qty4" value="1">
    <input type="hidden" name="price4" value="0">
    <INPUT TYPE="HIDDEN" NAME="nocart"></td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Mobile</p></td>
    <td><input type="text" name="product5[]" size="20" id="Mobile5" value="">
    <input type="hidden" name="qty5" value="1">
    <input type="hidden" name="price5" value="0">
    <INPUT TYPE="HIDDEN" NAME="nocart"></td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Guests</font></p></td>
    <td><input type="hidden" name="qty8" value="1">
    <input type="radio" name="productpr8" value="Guests NO" checked="checked"><font face="arial" color="navy" size="2">NO</font>
    <input type="hidden" name="qty8" value="1">
    <input type="radio" name="productpr8" value="Guests YES"><font face="arial" color="navy" size="2">YES</font></td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Number of Guests</p></td>
    <td><input type="text" name="product6[]" size="20" id="Guests6" value="">
    <input type="hidden" name="qty6" value="1">
    <input type="hidden" name="price6" value="0">
    <INPUT TYPE="HIDDEN" NAME="nocart"></td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Gift Voucher Required</font></p></td>
    <td><input type="hidden" name="qty7" value="1">
    <input type="radio" name="productpr7" value="Voucher NO" checked="checked"><font face="arial" color="navy" size="2">NO</font>
    <input type="hidden" name="qty7" value="1">
    <input type="radio" name="productpr7" value="Voucher YES"><font face="arial" color="navy" size="2">YES</font></td>
    <td></td>
    </tr>
    <tr>
    <td></td>
    <td><div align="center"><input type="button" name="Submit" value="submit" onClick="check('form1', this.name);">
    </FORM></div></td>
    <td></td>
    </tr>

    </table>

    DB.

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Jul 22 2013 19:53:48

    #2

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    How about something like this Don?

    <form action="http://ww11.aitsafe.com/cf/add.cfm";; method="post" name="form1" id="form1">
    <input name="userid" type="hidden" value="D661853">
    <input type="hidden" name="return" value="www.donbarrow.co.uk/rally_books.html">;;
    <input type="hidden" name="price" value="60.00">
    <table>
    <tr>
    <td><p align="right">Nominated First Name</p></td>
    <td><input type="hidden" name="product[]" value="{br}First Name -,"><input type="text" name="product[]" size="20" id="Name1" value="">
    </td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Nominated Last Name</p></td>
    <td><input type="hidden" name="product[]" value="{br}Last Name -,"><input type="text" name="product[]" size="20" id="Name2" value="">
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Email Address Address</p></td>
    <td><input type="hidden" name="product[]" value="{br}Email -,"><input type="text" name="product[]" size="20" id="Email3" value="">
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Tel No</p></td>
    <td><input type="hidden" name="product[]" value="{br}Phone -,"><input type="text" name="product[]" size="20" id="Telephone4" value="">
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Mobile</p></td>
    <td><input type="hidden" name="product[]" value="{br}Mobile -,"><input type="text" name="product[]" size="20" id="Mobile5" value="">
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Guests</font></p></td>
    <td><input type="hidden" name="product[]" value="{br},">
    <input type="radio" name="product[guest]" value="Guests NO" checked="checked"><font face="arial" color="navy" size="2">NO</font>
    <input type="radio" name="product[guest]" value="Guests YES"><font face="arial" color="navy" size="2">YES</font></td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right">Number of Guests</p></td>
    <td><input type="text" name="product[]" size="20" id="Guests6" value="">
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Gift Voucher Required</font></p></td>
    <td><input type="hidden" name="product[]" value="{br},">
    <input type="radio" name="product[voucher]" value="Voucher NO" checked="checked"><font face="arial" color="navy" size="2">NO</font>
    <input type="radio" name="product[voucher]" value="Voucher YES"><font face="arial" color="navy" size="2">YES</font></td>
    <td></td>
    </tr>
    <tr>
    <td></td>
    <td><div align="center"><input type="submit" value="Add to Cart">
    </FORM></div></td>
    <td></td>
    </tr>
    </table>

    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.




    Jul 22 2013 21:17:38

    #3

    Don

    Join date : 2008-09-18      Posts : 487

    Debbie,
    Thanks a million, that's just what I want.

    KR.

    Don.

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Jul 23 2013 13:15:05

    #4

    Don

    Join date : 2008-09-18      Posts : 487

    Well very nearly, although I can get the Validation to work in my Editor, it fails to work when uploaded.

    The js Validator script is also uploaded.

    <script type="text/javascript" src="formvalidator2.js"></script>

    function check(formname, submitbutton) {
    var errors = '';
    errors += checkText(formname, 'Name1', 'Pilots Name');
    errors += checkText(formname, 'Email2', 'Email Address');
    errors += checkText(formname, 'Telephone3', 'Telephone Number');
    errors += checkText(formname, 'Mobile4', 'Mobile Number');
    checkThisForm(formname, submitbutton, errors);
    }
    </script>
    </head>

    <form action="http://ww7.aitsafe.com/cf/add.cfm"; method="post" name="form1" id="form1">
    <input name="userid" type="hidden" value="98399624">
    <input type="hidden" name="return" value="www.737pilot.me.uk/tmm_30_min_course.html">;
    <INPUT TYPE="HIDDEN" NAME="product[]" VALUE="Gift Voucher - 30 Minutes Simulator Course">
    <input type="hidden" name="price" value="55.83">

    <table>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Nominated Pilots Name</font></p></td>
    <td><input type="hidden" name="product[]" value="{br}Pilots Name -,"><input type="text" name="product[]" size="20" id="Name1" value="">
    </td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Email Address</font></p></td>
    <td><input type="hidden" name="product[]" value="{br}Email -,"><input type="text" name="product[]" size="20" id="Email2" value="">
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Telephone Number</font></p></td>
    <td><input type="hidden" name="product[]" value="{br}Phone -,"><input type="text" name="product[]" size="20" id="Telephone3" value="">
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Mobile Number</font></p></td>
    <td><input type="hidden" name="product[]" value="{br}Mobile -,"><input type="text" name="product[]" size="20" id="Mobile4" value="">
    <td></td>
    </tr>
    <tr>
    <td></td>

    <td><div align="center"><input type="submit" value="Book Now" onClick="check('form1', this.name);">
    </FORM>

    Any help greatly received.

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Jul 23 2013 13:57:54

    #5

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    Check your submit button code. It is slightly different than your original. Maybe it makes a difference?

    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.




    Jul 24 2013 07:38:10

    #6

    GT

    Join date : 2008-09-18      Posts : 3207

    Hi Don,

    1/ You haven't download the validator script and uploaded it into your directory and linked to it:
    http://www.737pilot.me.uk/formvalidator2.js

    2/ You have opened a javascript section to hold the script that is in the page.

    3/ You haven't closed off the last td or tr or table.

    4/ You've placed an open div without a close of div inside a td.

    5/ Fix all errors that you've created in your page: http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.737pilot.me.uk%2Ftmm_30_min_course.html

    6/ You have not copied the button code.

    7/ You're sorry you asked now :)

    Download the script and link to it as in this fully working form:

    <script type="text/javascript" src="http://www.malsforms.com/formvalidator.js"></script>;
    <script type="text/javascript">
    function check(formname, submitbutton) {
    var errors = '';
    errors += checkText(formname, 'Name1', 'Pilots Name');
    errors += checkText(formname, 'Email2', 'Email Address');
    errors += checkText(formname, 'Telephone3', 'Telephone Number');
    errors += checkText(formname, 'Mobile4', 'Mobile Number');
    checkThisForm(formname, submitbutton, errors);
    }
    </script>
    </head>

    <form action="http://ww7.aitsafe.com/cf/add.cfm";; method="post" name="form1" id="form1">
    <input name="userid" type="hidden" value="98399624">
    <input type="hidden" name="return" value="www.737pilot.me.uk/tmm_30_min_course.html">;
    <input type="hidden" name="product[]" value="Gift Voucher - 30 Minutes Simulator Course">
    <input type="hidden" name="price" value="55.83">

    <table>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Nominated Pilots Name</font></p></td>
    <td><input type="hidden" name="product[]" value="{br}Pilots Name -,"><input type="text" name="product[]" size="20" id="Name1" value="">
    </td>
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Email Address</font></p></td>
    <td><input type="hidden" name="product[]" value="{br}Email -,"><input type="text" name="product[]" size="20" id="Email2" value="">
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Telephone Number</font></p></td>
    <td><input type="hidden" name="product[]" value="{br}Phone -,"><input type="text" name="product[]" size="20" id="Telephone3" value="">
    <td></td>
    </tr>
    <tr>
    <td><p align="right"><font face="arial" color="navy" size="2">Mobile Number</font></p></td>
    <td><input type="hidden" name="product[]" value="{br}Mobile -,"><input type="text" name="product[]" size="20" id="Mobile4" value="">
    <td></td>
    </tr>
    <tr>
    <td></td>
    <td><input type="button" name="Submit" value="Book Now" onclick="check('form1', this.name);" onkeypress="check('form1', this.name);"></td>
    </tr>
    </table>
    </form>

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

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




    Jul 26 2013 09:37:34

    #7

    Don

    Join date : 2008-09-18      Posts : 487

    Hi GT,

    Like you I can get it to work perfectly as a fully working validation form, but when it's uploaded it ceases to work, instead of validating it simply submits the order to the cart without the required info.

    Therefore I am ceasing to use the non-working validation.

    [ 7/ You're sorry you asked now :) ]- No I am not sorry I asked, just like yourself, everybody gets a first time problem and has to learn from someone else, as no doubt you have done in the past.

    Anyway, thanks for having a look.

    Kind Regards. DB.

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Jul 26 2013 10:04:26

    #8

    GT

    Join date : 2008-09-18      Posts : 3207

    The form I gave you in my previous reply works 100% Don.

    Product Quantity Price Amount
    Gift Voucher - 30 Minutes Simulator Course,
    Pilots Name - gt,
    Email - gt@malsforms.com,
    Phone - 01122334455,
    Mobile - 07799665544 Delete 55.83 55.83
    All prices are in Pounds Subtotal 55.83
    Tax VAT 11.17
    TOTAL 67.00

    You can see my form in use at:
    http://www.malsforms.com/don.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.




    Jul 26 2013 12:49:48

    #9

    Don

    Join date : 2008-09-18      Posts : 487

    GT,

    Thanks for your words of wisdom, I was concerned about using your <script type="text/javascript" src="http://www.malsforms.com/formvalidator.js"></script>; , if it's OK to use, then yes it works like a dream. do I have to seek permission ?

    Kind Regards.

    DB.

    www.donbarrow.co.uk
    www.pacenotes.com
    Please either Share or Like my Facebook




    Jul 27 2013 06:52:33

    #10

    GT

    Join date : 2008-09-18      Posts : 3207

    All you need to do is get my script:

    http://www.malsforms.com/formvalidator.js

    Now copy the contents, save it locally as formvalidator.js and upload it into root, then link to the js file from the page as:
    http://www.737pilot.me.uk/formvalidator.js

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

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