View Full Version : text change with drop down menu

08-11-2004, 11:15 PM
it has been days now since i have tried to get this thing to work... i need a drop-down menu that changes the price in the cell next to it, and then also changes the price in the paypal shopping cart all according to the item selected on the drop-down menu. the site i need this done on is http://www.arcing.net/arcing/d2collection/Least-armor.html, and the code to change text with a drop-down menu is here- http://www.dynamicdrive.com/dynamicindex1/combodescribe.htm

Willy Duitt
08-12-2004, 12:21 AM
Change the price to what?

I would advise changing your option values to indicate the prices you want so that someone actualy has something to work with. Otherwise it is a simple matter of assigning an id to the data cell and use an onchange event handler on the select to update the innerHTML of the data cell along with the forms.amount.value to reflect the selects value....

<BASE HREF="http://www.arcing.net/arcing/d2collection/">

<table width="100%" border="0" class="text_common">
<td height="99" colspan="5" align="center"><img src="images/eastarmorladder.jpg"> </td>
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<tr align="center" valign="middle">
<td height="88" valign="middle"><img src="D2_item_pics/armor7.jpg" width="56" height="65"></td>
<td width="15%" valign="middle"><a onClick='window.open("s-enigma.html","somewindow","height=500,width=619,scrollbars")' =""><img src="images/stats.jpg" border="0"></a></td>
<td width="53%" valign="middle"> <strong>Enigma Runeword</strong><br>
(Item varies! See Stats for more information)</td>
<td width="9%" valign="middle"><strong>$45.95</strong></td>
<td width="14%" valign="middle">
<td align="center" valign="middle"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="hidden" name="on0" value="Type">
<td><select name="os0">
<option value="Archon Plate">Archon Plate</option>
<option value="Sacred Armor">Sacred Armor</option>
<option value="Scarab Husk">Scarab Husk</option>
<option value="Wire Fleece">Wire Fleece</option>
<option value="Loricated Mail">Loricated Mail</option>
<option value="Great Hauberk">Great Hauberk</option>
<option value="Balrog Skin">Balrog Skin</option>
<option value="Kraken Shell">Kraken Shell</option>
<option value="Hellforge Plate">Hellforge Plate</option>
<option value="Lacquered Plate">Lacquered Plate</option>
<option value="Shadow Plate">Shadow Plate</option>
<option value="Boneweave">Boneweave</option>
<option value="Wyrmhide">Wyrmhide</option>
<option value="Dusk Shroud">Dusk Shroud</option>
<input type="image" src="images/add_to_cart.jpg" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="sales@arcing.net">
<input type="hidden" name="item_name" value="East Ladder Enigma">
<input type="hidden" name="amount" value="45.95">
<input type="hidden" name="cn" value="Requests?">
<input type="hidden" name="currency_code" value="USD">


08-12-2004, 04:17 AM
well when i change the option value it also changes in the cart. if u press add to cart u will see it says "type: and the armor you selected". that is the option value, so if I change that, then the buyer will not have a way of telling me which armor he wants :/. Getting this form with javascript to run with the paypal stuff is driving me crazy ><. Like when i give the form a different name it will not work either.

Willy Duitt
08-12-2004, 08:21 AM
Your current values mirror your options text. There is no need to duplicate this information when you can simply use the option value for the item cost as I suggested and use selectedIndex.text to get the type from the name of the option which was selected.....