Community Forums 

Main Content

Prevent zero value being submitted to cart

    Jun 30 2016 09:12:20

    #1

    henchard

    Join date : 2012-06-07      Posts : 5

    Hi thanks in advance. I don't use Mals extensively so I'm sure this may be something stupid on my part.

    I help a folk music festival with their workshop bookings and have this script which takes the bookings. Unfortunately I' ve just found (after a recent order) that if you don't select anything from the drop down lists it's possible to submit an order for 'nothing'. Is there an easy way to prevent this?

    <form action="http://www.aitsafe.com/cf/addmulti.cfm";;; method="post">
    <input type="hidden" name="userid" value="XXXXXXXXX">
    <input type="hidden" name="return" value="http://www.xxxxxxxx/workshops.html">;
    <input type="hidden" name="product1[]" value="Workshop">
    <input type="hidden" name="qty1" value="1">

    <select name="product1[]">
    <option selected value="">Select Workshop</option>
    <option value="Fiddle">Fiddle Workshop</option>
    <option value="Accordian">Accordian Workshop</option>
    <option value="Concertina">Concertina workshop</option>
    <option value="Banjo">Banjo</option>
    <option value="Guitar">Guitar</option>
    <option value="Singing">Singing</option>
    <option value="Set Dancing">Set Dancing</option>
    </select>

    <select name="productpr1" size="1">
    <option selected value="">Select Days</option>
    <option value="1 Day :25"> 1 Day Instrument/Singing Workshop </option>
    <option value="2 Day :50"> 2 Day Instrument/Singing Workshop </option>
    <option value="3 Day :60"> 3 Day Instrument/Singing Workshop </option>
    <option value="1 Day :10"> 1 Day Dance Workshop </option>
    <option value="2 Day :20"> 2 Day Dance Workshop </option>
    <option value="3 Day :25"> 3 Day Dance Workshop </option>
    </select>

    <input type="submit" value="Book Workshops">
    </form>



    Jun 30 2016 09:26:45

    #2

    GT

    Join date : 2008-09-18      Posts : 3207

    Use my force a selection script...

    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.




    Jun 30 2016 13:39:17

    #3

    henchard

    Join date : 2012-06-07      Posts : 5

    GT said Use my force a selection script...

    http://www.malsforms.com/force-selection.html


    Thanks for the quick response