Community Forums 

Main Content

Prevent zero value being submitted to cart

    Jun 30 2016 09:12:20



    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="";;; 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 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>

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

    Jun 30 2016 09:26:45



    Join date : 2008-09-18      Posts : 3235

    Use my force a selection script...

    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



    Join date : 2012-06-07      Posts : 5

    GT said Use my force a selection script...

    Thanks for the quick response