Community Forums 

Main Content

required option

    Sep 23 2008 20:11:51

    #1

    pam

    Join date : 2008-09-22      Posts : 2

    I have not been able to find the subject in the forum archives.

    Is there a way to require that a choice of options (drop down list) be made before sending to cart?

    Previously have used Americart and the code for a required option choice was:
    <OPTION value="=error= You must select loop"
    selected>Loop length</OPTION>

    I have both no-cost and added-cost options for a product and a choice from each option must be made to configure the product.

    The product code below is working otherwise, but will return an order with insufficient information if all options are not selected.

    <FORM METHOD="POST" ACTION="http://ww10.aitsafe.com/cf/addmulti.cfm">;
    <INPUT TYPE="HIDDEN" NAME="userid" VALUE="MYIDINFO">
    <input type="hidden" name="return" value="www.songofthephoenix.com/earrings3.php3">;
    <input type="hidden" name="product1[]" value="Gold filled basic earrings">
    <input type="hidden" name="qty1" value="1">
    <br>
    <select size="1" name="productpr1">
    <option selected value="">Select loop length
    <option value ="3/4 inch :28">3/4 inch</option>
    <option value ="7/8 inch :28">7/8 inch</option>
    <option value ="1 inch :28">1 inch</option>
    <option value ="1 1/8 inch :28">1 1/8 inch</option>
    <option value ="1 1/4 inch :28">1 1/4 inch</option>
    <option value ="1 3/8 inch :28">1 3/8 inch</option>
    <option value= "1 1/2 in :34">1 1/2 in + $6</option>
    <option value= "1 5/8 inch :34">1 5/8 in + $6</option>
    <option value= "1 3/4 in :34">1 3/4 in + $6</option>
    <option value= "1 7/8 in :34">1 7/8 in + $6</option>
    <option value= "2 in :34">2 in + $6</option>
    <option value= "2 1/8 in :34">2 1/8 in + $6</option>
    <option value= "2 1/4 in :34">2 1/4 in + $6</option>
    <option value= "2 3/8 in :34">2 3/8 in + $6</option>
    </select>
    <br> Over 1 3/8" - add $6
    <br>
    <select size="1" name="product1[]">
    <option selected value="">Select Y shape
    <option value="Standing">Standing</option>
    <option value="Walking">Walking</option>
    <option value="Running">Running</option>
    </select>
    <br>
    <input type="submit" value="Order my earrings">
    </form>

    Ultimately, I would prefer to have something that permits a choice of an item with two different prices/qualities and two additional options, one having an additional cost. This would eliminate having to have separate order forms for silver and for gold filled. I have not been able to locate information on coding that will allow something like this. Below is the code I'm currently using to do this on another cart:

    <form action="http://www.cartserver.com/sc/cart.cgi"; method=post>
    <input type=hidden name=item value="p-XXXX^sm_post^sm ribn ear^op1^op2">
    <select name=op1>
    <OPTION value="sterling - $30" selected>S/S - $30</OPTION>
    <OPTION value="GF - $32">G/F - $32</OPTION>
    </select>

    <td>
    <select name=op3>
    <OPTION value="=error= You must select loop"
    selected>Loop length</OPTION>
    <OPTION 1>3/4 inch
    <OPTION 2>7/8 inch
    <OPTION 3>1 inch
    <OPTION 4>1 1/8 inch
    <OPTION 5>1 1/4 inch
    <OPTION 5>1 3/8 inch
    <OPTION value="1 1/2 in - $3">1 1/2 inch (+ $3)</OPTION>
    <OPTION value="1 5/8 in - $3">1 5/8 inch (+ $3)</OPTION>
    <OPTION value="1 3/4 in - $3">1 3/4 inch (+ $3)</OPTION>
    <OPTION value="1 7/8 on - $3">1 7/8 inch (+ $3)</OPTION>
    <OPTION value="2 in - $3">2 inches (+ $3)</OPTION>
    <OPTION value="2 1/8 in - $3">2 1/8 inches (+ $3)</OPTION>
    <OPTION value="2 1/4 in - $3">2 1/4 inches (+ $3)</OPTION>
    <OPTION value="2 3/8 in - $3">2 3/8 inches (+ $3)</OPTION>
    <OPTION value="2 1/2 in - $4">2 1/2 inches (+ $4)</OPTION>
    </select>

    &nbsp;&nbsp;<select name=op4>
    <OPTION value="=error= You must select Y-shape"selected>
    "Y" shape</OPTION>
    <OPTION 1>standing
    <OPTION 2>walking
    <OPTION 3>running</OPTION>
    </select>

    <b> Qty: </b><SELECT NAME=op2>
    <OPTION selected 1>1
    <OPTION 2>2
    <OPTION 3>3
    <OPTION 4>4
    <OPTION 5>5</OPTION>
    </SELECT>

    <td><input type="image" valign="bottom" name=add
    src="images/bttn_buy.jpg" border="0" cache style="HEIGHT: 26px; WIDTH: 95px"
    >
    <br><br clear=all></FONT></td>
    <CENTER></CENTER></form>

    Thanks for any help you can offer.

    Pam



    Sep 24 2008 15:28:32

    #2

    slsdoug

    Join date : 2008-09-18      Posts : 53

    You can write a little JavaScript to see that is selected before the form is submitted.

    Doug

    Doug D
    Smartlab Software




    Sep 25 2008 00:02:39

    #3

    JameyLynn

    Join date : 2008-09-18      Posts : 97

    JameyLynn
    Howaco Glass Supply Co
    www.howacoglass.com




    Oct 01 2008 06:13:00

    #4

    pam

    Join date : 2008-09-22      Posts : 2

    Thank you for your suggestions.

    I had seen the script examples but hoped that it would be possible to do it using only HTML.

    Pam



    Oct 08 2008 22:44:49

    #5

    FragrantCellar

    Join date : 2008-10-08      Posts : 1

    Pam, did you ever figure out how to do this using HTML?