I've got one that has me scratching my head, not sure exactly how to do this. I've got a drop down menu that I would like to consider mandatory. If it's not selected, I'd like to display an error on the page close to the drop-down, if it is selected, the form should post to another page.
I've tinkered with a little javascript which I couldn't figure out. I've used a switch to display different dropdowns and that works fine, I've just included one as an example. Here's what the form looks like:
<FORM NAME="CORDS" METHOD="POST" ACTION="checkmeout.php">
<INPUT TYPE="HIDDEN" NAME="product" VALUE="<?php echo $item3; ?>">
<INPUT TYPE="HIDDEN" NAME="price" VALUE="<?php echo $price; ?>">
<INPUT TYPE="HIDDEN" NAME="pagetype" VALUE="neck">
switch ($neck) {
case "A":
echo "
<input type=\"hidden\" name=\"product[]\" value=\"$item3\">
<select name=\"product[]\"><option value=\"\">Select your cord or chain:</option>
<option value=\"18-inch silver chain\">18-inch Sterling silver box chain</option>
<option value=\"16-inch black cord\">16-inch black rubber cord</option>
<option value=\"18-inch black cord\">18-inch black rubber cord</option></select>";
break;
}
?>
<br><br>Include giftbox
<input type="checkbox" name="giftbox" value="giftbox">
<INPUT TYPE="SUBMIT" Value="Add to Cart"> </FORM>