PDA

View Full Version : Form data validation help



mtdewman
03-26-2007, 06:07 PM
I have put together a website for a food prep business where people can order meals online. On one of the order forms, they can choose from several different meals but a maximum of 3 of any one meal. For the package, they need to choose at least 15 total meals (once they choose 15, they can add more). I have drop down lists by each meal where they can choose 0, 1, 2 or 3 of each meal. What I need is a script that will pop up a notice if the total of those selections is less than 15 total. (More than 15 is OK) I know this can be done but I'm much more on the graphic design side of things than the coding.

Any help would be appreciated. Would it help if I posted the coding for the form?

Medyman
03-27-2007, 06:09 AM
Any help would be appreciated. Would it help if I posted the coding for the form?


Yes, it would.

mtdewman
03-27-2007, 11:34 AM
Here is the coding for the form, including the first food item that can be selected:


<form method="post"
action="http://www.miraculousmeals.com/cgi-bin/FormMail.pl">
<div style="text-align: center;"><input
name="recipient"
value="tammy@miraculousmeals.com, dntrose@sbcglobal.net, webmaster@miraculousmeals.com, gcollett@mpks.net"
type="hidden"> <input name="subject"
value="Online Registration" type="hidden"> <input
name="required"
value="realname,Address,City/State/Zip,Telephone,email,Pickup Date"
type="hidden"><input name="sort"
value="order:realname,Address,City/State/Zip,Telephone,email,Pickup Date,Caribbean Chicken &amp; Steamed Broccoli,Caribbean Jerk Chicken &amp; Side Salad,Citrus Mesquite Pork &amp; Broccoli,Crock Pot Beef &amp; Seasoned Carrots,Green Chili Eggs,Herbed Pepper Steak &amp; California Veggies,Jerk Pork with Steamed Broccoli,Korean Pork Chop &amp; Asian Vegetables,Montreal Chicken &amp; Zucchini Squash Mix,Montreal Steak with Peppers &amp; Onions,Quick &amp; Easy Omlet,Roasted Rosemary Chicken with Asparagus,Swiss Steak &amp; Green Beans,Teriyaki Chicken &amp; Stir Fry Vegetables,Texas Pork Chop &amp; Fiesta Vegetables,Taco Chili,White Chili,Additional Comments/Special Instructions,Referred By:"
type="hidden"> </div>
<table
style="text-align: left; margin-left: auto; margin-right: auto;"
border="0">
<tbody>
<tr align="center">
<td colspan="2"><a target="_blank"
href="works.html#cancellation_policy"><span
style="font-weight: bold;">Cancellation Policy</span></a><br>
<br>
</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td align="right"><b>Name:</b></td>
<td><input name="realname" size="50"
type="text"></td>
</tr>
<tr>
<td align="right"><b>Address:</b></td>
<td><input name="Address" size="50"
type="text"></td>
</tr>
<tr>
<td align="right"><b>City, ST Zip:</b></td>
<td><input name="City/State/Zip" size="50"
type="text"></td>
</tr>
<tr>
<td align="right"><b>Telephone:</b></td>
<td><input name="Telephone" size="50"
type="text"></td>
</tr>
<tr>
<td align="right"> <b>Email Address:</b></td>
<td><input name="email" size="50"
type="text"> </td>
</tr>
<tr>
<td style="text-align: right;"><b>Pickup
Date:</b></td>
<td>
<select name="Pickup Date">
<option></option>
<option>Monday, April 2, 2007</option>
<option>Monday, April 9, 2007</option>
<option>Monday, April 16, 2007</option>
<option>Monday, April 23, 2007</option>
<option>Monday, April 30, 2007</option>
<option>Monday, May 7, 2007</option>
<option>Monday, May 14, 2007</option>
<option>Monday, May 21, 2007</option>
<option>Monday, May 28, 2007</option>
</select>
</td>
</tr>
<tr>
<td></td>
<td><br>
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="2">Select
quantity of each menu item below for a <span
style="font-weight: bold;">total of fifteen (15) items</span>
<br>
to make up your package. <br>
<span style="font-weight: bold;">Maximum quantity
of three (3)</span>
per any one menu item.<br>
You may also order individual meals above your regular package.</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td style="text-align: right;"> <b><br>
</b></td>
<td align="left">
<select name="Caribbean Chicken &amp; Steamed Broccoli">
<option></option>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
&nbsp;<b>Caribbean Chicken &amp; Steamed Broccoli</b></td>
</tr>
<tr>
<td></td>
<td>