Demo: How to make Fields Require
Home Demos Features Get Started Prices Help Desk Contact

It's easy to make fields required. Just enter the tilde character ~ before the field. Be sure to use variables that will be recognized by CoolCart.

name="~Qty", name="~Describe", name="~Price", name="~Color", name="~Size", name="~AddOn1" - name="~AddOn15", name="~NAddOn1" - name="~NAddOn4", name="~ID".

You can make a required field using text input fields, drop down boxes, and radio buttons but not with check boxes because the cart cannot detect a checkbox if it hasn't been checked.

Required field using a Text Input Field:
<Input type="text" name="~Color" size=20 value="">

Enter Color

Required field in a Drop Down Box:
To make a required field work in a drop down box, you must make the default value empty. This will require the shopper to select a valid option from the drop down.
 
<select name="~Color">
   <option value="" selected>-- Select Color --
   <option value="Red">Red
   <option value="Blue">Blue
   <option value="Gold^3.50">Gold - Add $3.50
</select>

Required field using a radio button:
<input type="radio" checked name="~AddOn2" value=""> Not selected
<input type="radio" name="~AddOn2" value="Large"> Large
<input type="radio" name="~AddOn2" value="Small"> Small
 

Not selected Large Small
 
Note: Normally you wouldn't use the same variable name within a Form between <form> and </form>, however, radio buttons is the exception.


Powered by CoolCart.Net