Product Selector

Completed modifications to the NOP Shopping Cart. Additions, modifications, and more.

Moderators: Stefko, Randy, Rosey, Koibito

Product Selector

Postby Randy » Sun Jul 18, 2004 1:12 pm

For a drop-down list for product selection, different prices for variations of the same item or items with different catalogue numbers for different sizes you can use the following mod:

To nopcart.js add the following:

Code: Select all
//-----------------------------------------------------------||
// FUNCTION:    AddOneOfManyToCart                           ||
// PARAMETERS:  Form Object PRODUCTSELECTOR                  ||
// RETURNS:     Product parameters to order form            ||
// PURPOSE:     selects one of many products with different size,  ||
//              cost, shipping and/or tax to add to shopping cart  ||
//-----------------------------------------------------------||
function AddOneOfManyToCart(formToUpdate)
{

   selectedObj = formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex];

   nameVal = selectedObj.getAttribute("name");
   if (nameVal == "select") {
      alert('Please select an option');
      return false;
   }

   formToUpdate.NAME.value = nameVal;

   costVal = selectedObj.getAttribute("cost");
   formToUpdate.PRICE.value = costVal;


   id_numVal = selectedObj.getAttribute("id_num");
   formToUpdate.ID_NUM.value = id_numVal;

   shippingVal = selectedObj.getAttribute("shipping");
   formToUpdate.SHIPPING.value = shippingVal;

   switch( formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex].value ) {
   }
   AddToCart(formToUpdate);
}


//-----------------------------------------------------------||


Then to your product page add this

Code: Select all
<!-- -=#=-=#=- start of item -->
<A name="33251"></A>
<IMG src="./images/CB500b.jpg" alt="Sheep Dip" width="100" height="145" border="0"><BR>
<B>Product Selector Mod & & $1.00 and $10.00</B>
This product tests the AddOneOfManyToCart(this.form) function<BR><BR>
      <!--Shopping Cart Begin-->
<form name=order>
<input name="PRICE" type=hidden id="PRICE" value="">
<input name=NAME type=hidden id="NAME" value="">
<input name=ID_NUM type=hidden id="ID_NUM" value="">
<input type=hidden name="SHIPPING" value="0.00">
<select name="PRODUCTSELECTOR">
<option selected name="select">Please select size</option>
<option cost="1.00" id_num="33251" name="1L bottle Sheep Dip" shipping="1.00">1 Litre bottle $1.00 Shipping $1.00 </option>
<option cost="1.00" id_num="33253" name="1L bag Sheep Dip" shipping="1.50">1 Litre bag $1.00 shipping $1.50 </option>
<option cost="3.00" id_num="33252" name="4L can Sheep Dip" shipping="2.00">4 Litre can $3.00 Shipping $2.00 </option>
<option cost="10.00" id_num="33254" name="205L Drum Sheep Dip" shipping="120.00">205 Litre (45 Gal/55 US Gal) Drum $200.00 Shipping $120.00</option>
</select><BR>
Quantity: <input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.value)' value="1"> & &
<input type="image" onClick='AddOneOfManyToCart(this.form)'  src="./images/a2_cart.gif" name="buy" WIDTH="38" HEIGHT="30"  border=0 value="Add to Cart" ALT="Add to Cart" align=top>
</form>
      <!--Shopping Cart End  -->
<BR><BR>

<!-- -=*=-=*=- End of item -->



NOTE:
In the selction use lower case. The function will then "translate" for you.
cost becomes PRICE, id_num = ID_NUM, name = NAME and shipping=SHIPPING.

The form action is onClick='AddOneOfManyToCart(this.form)' this translates your selection into the proper format and then automatically goes to the "AddToCart" function.

for more discussion on this mod search for "different prices", or see this post:
http://www.nopdesign.com/forum/viewtopic.php?t=1908

This is not a new mod, but brings together the instructions in one post.
R
Last edited by Randy on Thu Jan 05, 2006 11:03 pm, edited 1 time in total.
JRS SERVICES
e-commerence solutions
www.jrsservices.net
Randy
Guru
 
Posts: 1511
Joined: Tue Apr 22, 2003 12:21 pm
Location: Thunder Bay, Ontario

THANK YOU THANK YOU THANK YOU!!!!

Postby VitroGSR » Wed Jul 21, 2004 3:38 am

Randy,

THANKS SOOO MUCH. This finally works on my webpages, but there is one problem; when you go to look at the shopping cart my shipping value is "NaN.aN". I don't know how I could've gone wrong - I copied your exact code and pasted it into an unmodified version of nopcart.js, and then I made a quick webpage by copying and pasting the code you supplied. What should I do?

-Steve
[Embrace Change]
VitroGSR
 
Posts: 13
Joined: Sat Jul 17, 2004 5:42 am

Postby Randy » Wed Jul 21, 2004 4:27 am

When you get a NaN error it usually means you are trying to do math with a string or null variable.

make sure the shipping is 0.00 rather than ""

If all else fails, try adding these lines right above the "switch" line :

SHIPPING+=1;
alert('shipping= '+shipping+ "SHIPPING PLUS ONE = '+ SHIPPING);

If it works there, try adding an "alert" in the AddToCart function with the appropriate variables...

R
Randy
Guru
 
Posts: 1511
Joined: Tue Apr 22, 2003 12:21 pm
Location: Thunder Bay, Ontario

Works Great

Postby VitroGSR » Wed Jul 21, 2004 4:46 pm

Works fine now - thanks a bunch man

-Steve
[Embrace Change]
VitroGSR
 
Posts: 13
Joined: Sat Jul 17, 2004 5:42 am

One more thing

Postby VitroGSR » Wed Jul 21, 2004 4:49 pm

One more thing - how would i modify the code so if the cart is empty an alert pops up saying this and doesn't let the customer checkout?

-Steve
[Embrace Change]
VitroGSR
 
Posts: 13
Joined: Sat Jul 17, 2004 5:42 am

Postby Randy » Wed Jul 21, 2004 9:54 pm

Line 98, under Options for everyone, change
MinimumOrder = 0.00;
to
MinimumOrder = 0.01;

R
Randy
Guru
 
Posts: 1511
Joined: Tue Apr 22, 2003 12:21 pm
Location: Thunder Bay, Ontario

Re: Product Selector

Postby sammy_J » Fri Jul 30, 2004 2:38 pm

Hi
thanks for this Mod it's just what I'm looking for. However I think you've missed out some " marks in your html code. I'm not a genius so I could be wrong but I thought I would point it out in case I am right, if I'm not your welcome to laugh at me :D


Randy wrote:
Code: Select all
<option selected name="select">Please select size</option>
<option cost="1.00" id_num="33251" name="1L bottle Sheep Dip" shipping="1.00">1 Litre bottle $1.00 Shipping $1.00 </option>
<option cost="1.00" id_num="33253" name="1L bag Sheep Dip shipping="1.50">1 Litre bag $1.00 shipping $1.50 </option>
<option cost="3.00" id_num="33252" name="4L can Sheep Dip shipping="2.00">4 Litre can $3.00 Shipping $2.00 </option>


I think it should read
Code: Select all
<option selected name="select">Please select size</option>
<option cost="1.00" id_num="33251" name="1L bottle Sheep Dip" shipping="1.00">1 Litre bottle $1.00 Shipping $1.00 </option>
<option cost="1.00" id_num="33253" name="1L bag Sheep Dip" shipping="1.50">1 Litre bag $1.00 shipping $1.50 </option>
<option cost="3.00" id_num="33252" name="4L can Sheep Dip" shipping="2.00">4 Litre can $3.00 Shipping $2.00 </option>



the quotation marks were missing at the end of the name section

Right I'm off to continue setting up my cart (I'm sure this was supposed to be a quick job 6months later I'm sure I can see the light lol )

Sam
sammy_J
 
Posts: 11
Joined: Fri Jul 30, 2004 2:27 pm

Product Selector

Postby cgwen » Mon Aug 02, 2004 1:04 am

I'm having a problem with the product selection code, when I choose an option and select Buy Now and go to my cart the quantity gets updated but the product does not go to the cart , it is just blank. Any ideas on how to correct this? I put the code in the nopcart.js and then on my page. Here is my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT SRC="language-en.js"></SCRIPT>
<SCRIPT SRC="nopcart.js">
//=====================================================================||
// NOP Design JavaScript Shopping Cart ||
// ||
// For more information on SmartSystems, or how NOPDesign can help you ||
// Please visit us on the WWW at http://www.nopdesign.com ||
// ||
// JavaScript Shop Module, V.4.4.0 ||
//=====================================================================||
</SCRIPT>




</head>

<body>

<!-- -=#=-=#=- start of item -->
<A name="33251"></A>
<IMG src="file://///Laptop/Laptop%20C/MYSITE/Test/100_0649%20copy.jpg" alt="Sheep Dip" width="200" height="150" border="0"><BR>
<b>Ladies Tank Top </b><BR>
<!--Shopping Cart Begin-->
<FORM NAME=order ACTION="managecart.htm" onSubmit="AddToCart(this);">
<input name="PRICE" type=hidden id="PRICE" value="">
<input name=NAME type=hidden id="NAME" value="">
<input name=ID_NUM type=hidden id="ID_NUM" value="">
<input type=hidden name="SHIPPING" value="0.00">
<select name="PRODUCTSELECTOR">
<option selected name="select">Please select size</option>
<option cost="16.00" id_num="33251" name="Small Tank Top" shipping="0.00">Small </option>
<option cost="19.00" id_num="33253" name="Small Tank Top w/Personalization=" shipping="0.00">Small w/ Personalization </option>
<option cost="16.00" id_num="33254" name="Medium Tank Top" shipping="0.00">Medium </option>
<option cost="19.00" id_num="33255" name="Medium Tank Top w/ Personalization" shipping="0.00">Medium w/ Personalization</option>
</select><BR>
Quantity: <input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.value)' value="1">
<input type="image" onClick='AddOneOfManyToCart(this.form)' src="file://///Laptop/Laptop%20C/MYSITE/Test/images/buynow.gif" name="buy" WIDTH="90" HEIGHT="35" border=0 value="Add to Cart" ALT="Add to Cart" align=top>
</form>
<!--Shopping Cart End -->
<BR><BR>

<!-- -=*=-=*=- End of item -->





</body>
</html>
cgwen
 
Posts: 4
Joined: Sat Jul 31, 2004 3:23 pm

Re: Product Selector

Postby Randy » Mon Aug 02, 2004 2:34 am

cgwen wrote:I'm having a problem with the product selection code...

<!--Shopping Cart Begin-->
<FORM NAME=order ACTION="managecart.htm" onSubmit="AddToCart(this);">

<input type="image" onClick='AddOneOfManyToCart(this.form)' src="file://///Laptop/Laptop%20C/MYSITE/Test/images/buynow.gif" name="buy" WIDTH="90" HEIGHT="35" border=0 value="Add to Cart" ALT="Add to Cart" align=top>

Dump the stuff in red...

You are comfusing nopcart.js with the onSubmit and the onClick sending the item to two different functions (The onSubmit takes precidence). Just use the onClick...that function sends the item info to the add to cart function after it does it's thing.

Randy
Randy
Guru
 
Posts: 1511
Joined: Tue Apr 22, 2003 12:21 pm
Location: Thunder Bay, Ontario

Product Selector Total

Postby cgwen » Wed Aug 04, 2004 5:20 pm

I'm have a problem with the product selector. It works fine until I get to the managecart page where my total is Nan... I've searched the boards and tried a few of the suggestions but they did not help. Any suggestions would greatly be appreciated. Here is my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Polo Shirts</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<SCRIPT SRC="language-en.js"></SCRIPT>
<SCRIPT SRC="nopcart.js">
//=====================================================================||
// NOP Design JavaScript Shopping Cart ||
// ||
// For more information on SmartSystems, or how NOPDesign can help you ||
// Please visit us on the WWW at http://www.nopdesign.com ||
// ||
// JavaScript Shop Module, V.4.4.0 ||
//=====================================================================||
</SCRIPT>
<SCRIPT>
function AddOneOfManyToCart(formToUpdate)
{
selectedObj = formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex];

nameVal = selectedObj.getAttribute("name");
if (nameVal == "NOTHING") {
alert('Please select a product');
return false;
}

formToUpdate.NAME.value = nameVal;

costVal = selectedObj.getAttribute("cost");
formToUpdate.PRICE.value = costVal;


id_numVal = selectedObj.getAttribute("id_num");
formToUpdate.ID_NUM.value = id_numVal;

shippingVal = selectedObj.getAttribute("shipping");
formToUpdate.SHIPPING.value = shippingVal;

switch( formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex].value ) {
}
AddToCart(formToUpdate);
}
</script>
</head>

<body bgcolor="#000000" background="Just-Dancin%27-Around3_thumb.gif" text="#33FF00">

<p>&</p>
<p align="center"><img src="Just-Dancin%27-Around2.gif" width="448" height="143"></p>
<p align="center">&</p>
<p align="center">&</p>
<p align="center">&</p>
<p align="center">&</p>
<p align="center">& </p>
<p align="center">&</p>
<p align="center">&</p>
<p align="center"><a href="managecart.htm"><img src="reviewandcheckout.gif" width="151" height="31" border="0"></a><a href="order.htm"><img src="moreshopping.gif" width="125" height="31" border="0"></a></p>
<table width="100%" border="1" cellspacing="2" cellpadding="2">
<tr>
<td width="50%">
<div align="center">
<p><img src="100_0651%20copy.jpg" width="200" height="150"></p>
<p>&</p>
<p><strong><font size="3">Polo Shirt</font></strong></p>
<p><font size="3"><strong>50/50 Cotton Pique</strong></font></p>
<p><strong></strong></p>
</div></td>
<td valign="top">
<FORM NAME=order ACTION="managecart.htm">
<input name=PRICE type=hidden id="PRICE" value="">
<input name=NAME type=hidden id="NAME" value="">
<input name=ID_NUM type=hidden id="ID_NUM" value="">
<input type=hidden name=SHIPPING value="0.00">
<p><font size="3"><strong>Size:</strong></font> & & & &&&
<select name="PRODUCTSELECTOR">
<option cost ="22.00" id_num="POLOSM" name = "Small Polo">Small($22.00</option>
<option cost ="25.00" id_num="POLOSMP" name="Small Polo w/ Personalization">Small w/ Personalization ($25.00)</option>
<option cost ="22.00" id_num="POLOMED" name ="Medium Polo">Medium ($22.00)</option>
<option cost ="25.00"id_num="POLOMEDP" name ="Medium Polo w/ Personalization">Medium w/ Personalization($25.00)</option>
<option cosr ="22.00" id_num="POLOLG" name="Large Polo">Large($22.00)</option>
<option cost ="25.00" id_num="POLOGP" name="Large Polo w/ Personalization">Large w/ Personalization($25.00)</option>
<option cost ="22.00" id_NUM="POLOXLG" name="X-Large Polo">X-Large($22.00)</option>
<option cost ="25.00" id_num="POLOXLGP" name="X-Large Polo w/ Personalization">X-Large w/ Personalization($25.00)</option>
<option cost ="24.00" id_num="POLO2X" name="2X Polo">2X($24.00)</option>
<option cost ="27.00" id_num="POLO2XP" name="2X Polo w/ Personalization">2X w/ Personalization($27.00)</option>
<option cost ="24.00" id_num="POLO3X" name="3X Polo">3X Polo($24.00)</option>
<option cost ="27.00" id_num="POLO3XP" name="3X Polo w/ Personalization">3X w/ Personailzation($27.00)</option>
</select>
</p>
<p><font size="3"><strong>Color: </strong></font>
<select name="ADDITIONALINFO" size="1">
<option value ="Color White">White</option>
<option value ="Color Black">Black</option>
<option value ="Color Royal">Royal</option>
<option value = "Color Red">Red</option>
<option value ="Color Heather Grey">Heather Grey</option>
</select>
</p>

<p><font size="3"><strong>Embroidery Color:</strong></font>
<select name="ADDITIONALINFO2" size="1">
<option value ="EM Color: Lime w/ Electric Blue">Lime w/ Electric Blue</option>
<option value ="EM Color: Electric Blue w/ Pink">Electric Blue w/ Pink</option>
<option value ="EM Color: All Black">All Black</option>
</select>
</p>
<p><font size="3"><strong>If you have chosen Personalization, please type your name as you would like it to appear:

<input name="USERENTRY" type="text" maxlength="35">

and choose location:
<select name="ADDITIONALINFO3" size="1">
<option value="PersonalizationLoc:Right Chest">Right Chest</option>
<option value="PersonalizationLoc:Sleeve">Sleeve</option>
</select>


<p><strong>Quantity</strong>:
<input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.value)' value="1">
</p>
<p>
<input type="image" onClick='AddOneOfManyToCart(this.form)' src="images/buynow.gif" name="buy2" WIDTH="90" HEIGHT="35" border=0 value="Add to Cart" ALT="Add to Cart" align=top>


</p>

</form><p>&</p></td>

</table>
<p align="center"> <img src="reviewandcheckout.gif" width="151" height="31"><img src="moreshopping.gif" width="125" height="31"></p>
</body>
</html>



Thanks
cgwen
 
Posts: 4
Joined: Sat Jul 31, 2004 3:23 pm

options info not being passed to cart

Postby rrmccabe » Tue Aug 17, 2004 5:32 pm

This mod is passing a base price and description to my checkout (if I have it added, but not adding the information and price from the dropdown mod to it.

I am running a stock script with the shipping dropdown add-on.

Here is my code.
Everything seems to work but I am getting no product info, id or OPTION price when passed to the cart. It will pass base price if I add that.

The only mod I am running is the shipping dropdown options.

Thanks Rich

Here is my product code
<!--Shopping Cart Begin-->
<FORM NAME=order ACTION="managecart.html" onSubmit="AddToCart(this);">
<input name="PRICE" type=hidden id="PRICE" value="">
<input name=NAME type=hidden id="NAME" value="">
<input name=ID_NUM type=hidden id="ID_NUM" value="">
<input type=hidden name="WEIGHT" value="0.00">
<input type=hidden name="SHIPPING" value="0.00">

<select name="PRODUCTSELECTOR">
<option selected name="select">Please select size</option>
<option cost="1.00" id_num="33251" name="1L bottle Sheep Dip" weight="1.5" shipping="1.00">1 Litre bottle $1.00 Shipping $1.00 Weight 1.5</option>
<option cost="1.00" id_num="33253" name="1L bag Sheep Dip" weight="1.25" shipping="1.00">1 Litre bag $1.00 shipping $1.00 Weight 1.25</option>
<option cost="3.00" id_num="33252" name="4L can Sheep Dip with hady pour spout" weight="4.5" shipping="2.00">4 Litre can $3.00 Shipping $2.00 Weight 4.5</option>
<option cost="10.00" id_num="33254" name="255L Drum Sheep Dip" weight="225" shipping="120.00" >255 Litre (45 Gal/55 US Gal) Drum $200.00 Shipping $120.00 Weight 255</option>
</select><BR>
Quantity: <input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.value)' value="1"> & &
<input type="image" onClick='AddOneOfManyToCart(this.form)' src="./images/a2_cart.gif" name="buy" WIDTH="38" HEIGHT="30" border=0 value="Add to Cart" ALT="Add to Cart" align=top>
</form>
<!--Shopping Cart End -->
rrmccabe
 
Posts: 10
Joined: Wed Aug 11, 2004 6:46 pm

Postby Stefko » Wed Aug 18, 2004 5:41 am

Have you added the function to either you product page or to the nopcart.js file? This requires two seperate sections of code, you list one of them but not the function itself!!
KFL Technologies
Web-Enabled Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 833
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Option pop-up

Postby muskokee » Wed Oct 26, 2005 1:58 am

Hi this is a great addition to the cart. Another thing I was looking for to make the cart compact and interactive! :D
There is just one question, hopefully a quick one for you Randy.

I was trying out the new option selector and I forgot to select an option (nope, not a blond ). A great pop-up appears that asks me to select an option. I hit the required "OK" to clear the pop-up and it shuttles me off to "managecart" rather than back to my product page to select the option.

Is there anything I can do about this?

Thanks a lot :!:

Sheri
muskokee
 
Posts: 6
Joined: Mon Oct 24, 2005 3:34 pm

Postby Randy » Thu Oct 27, 2005 12:51 pm

In the nopcart.js file, make sure the last line of the alert is

return false;

You could also place a return false; at the end of the onSubmit in the product page:

Code: Select all
<FORM NAME=order ACTION="productpage.html" onSubmit="'AddOneOfManyToCart(this.form); return false">


Randy
Randy
Guru
 
Posts: 1511
Joined: Tue Apr 22, 2003 12:21 pm
Location: Thunder Bay, Ontario

Postby muskokee » Thu Oct 27, 2005 2:26 pm

Hi Randy,

Thanks for getting back so quickly.

I have gone to nopcart.js and found that there was the return false; command there but it was separated from the alert with a ;. I removed the ; and it did not do anything :( . So, then I went to the productpage but there is not an "onsubmit" command in the script for this mod. So, I changed the "ACTION" to read my product page rather than the cartpage and it did solve the problem but added a <p> to the page when I tested submitting an order without selecting an option, so that my form actually moved one <p> down the page. I selected an option and sent the order... but because I had removed the action to go to the cart, it remained on the product page (which I don't necessarily mind, but I would prefer only to be redirected to the product page should I not select an option and continue to go to the cart when I select it properly).

Trucking on, I found the "onclick" command to "addoneofmanytocart", so at the end of that command I inserted a "return false" so that it looked like this:

<input type="image" onClick= "'AddOneOfManyToCart(this.form)'"; return false; src="images/cartbutton2.gif" name="buy" width="95" height="28" border=0 value="Add to Cart" ALT="Add to Cart" align=top>

This only served to not have the pop-up appear but still sent me to the cart (as I had changed the action back to managecart.html to test it again).

Hope this is understandable. I really appreciate your help. I am delving into javascript in hopes of gaining some understanding. :?

I will post my two scripts/codes (maybe I have changed something from the original that I cannot see) for reference.

PRODUCT PAGE:

<!--Shopping Cart Begin-->
<form name=order ACTION= "managecart.html">
<input name="PRICE" type=hidden id="PRICE" value="">
<input name=NAME type=hidden id="NAME" value="">
<input name=ID_NUM type=hidden id="ID_NUM" value="">
<input type=hidden name="SHIPPING" value="0.00">
</td>
<td width="179%" height="186" align="center"><b>BANG!</b>
<p>enter description</p>
<p>&nbsp;</p>
<select name="PRODUCTSELECTOR" size="1">
<option selected name="select">Please select a level
<option cost="2.50" id_num="LA1bang1" name="Pink level BANG!" shipping="0.00">Pink
level </option>
<option cost="2.50" id_num="LA1bang2" name="Yellow level BANG!" shipping="0.00">Yellow
level </option>
<option cost="2.50" id_num="LA1bang3" name="Blue level BANG!" shipping="0.00">Blue
Level </option>
<option cost="2.50" id_num="LA1bang4" name="Green level BANG!" shipping="0.00">Green
Level </option>
</select>
Quantity: <input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.value)' value="1">
<input type="image" onClick= 'AddOneOfManyToCart(this.form)'; src="images/cartbutton2.gif" name="buy" width="95" height="28" border=0 value="Add to Cart" ALT="Add to Cart" align=top>
</form>
<!--Shopping Cart End -->


NOPCART.JS:

function AddOneOfManyToCart(formToUpdate)
{

selectedObj = formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex];

nameVal = selectedObj.getAttribute("name");
if (nameVal == "select") {
alert('Please select an option');
return false;
}

formToUpdate.NAME.value = nameVal;

costVal = selectedObj.getAttribute("cost");
formToUpdate.PRICE.value = costVal;


id_numVal = selectedObj.getAttribute("id_num");
formToUpdate.ID_NUM.value = id_numVal;

shippingVal = selectedObj.getAttribute("shipping");
formToUpdate.SHIPPING.value = shippingVal;

switch( formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex].value ) {
}
AddToCart(formToUpdate);
}


Thanks
Sheri
P.S. I did try your suggestion for the return false with the "onclick" command by tucking both onclick and return false in double quotation marks, but it did nothing. Again another :(
muskokee
 
Posts: 6
Joined: Mon Oct 24, 2005 3:34 pm

Next

Return to Modifications

Who is online

Users browsing this forum: No registered users and 1 guest

cron