Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    text change with drop down menu

    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/d2colle...ast-armor.html, and the code to change text with a drop-down menu is here- http://www.dynamicdrive.com/dynamici...bodescribe.htm

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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....

    Code:
    <BASE HREF="http://www.arcing.net/arcing/d2collection/">
    
                <table width="100%" border="0" class="text_common">
                  <tr>
                    <td height="99" colspan="5" align="center"><img src="images/eastarmorladder.jpg"> </td>
                  </tr>
         <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">
                      <table>
                        <tr>
                          <td align="center" valign="middle"><font face="Verdana, Arial, Helvetica, sans-serif">
                            <input type="hidden" name="on0" value="Type">
                          </font></td>
                          <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>
         </select></td>
                        </tr>
                      </table>
                      <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">
                    </td>
                  </tr>
         </form>
        </table>
    .....Willy

  • #3
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.....

    .....Willy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •