SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot frosco's Avatar
    Join Date
    Jul 2003
    Location
    WA state
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Two Values in Combo Box?

    I have a combo box in which the value of each option is a file path to an image. When selected, that image will show above the combo box. The problem I have is that when I submit the form, the filepath is passed on as the value, and I need the name passed on as the value.

    Is there a way to do that?

    Here is what one of my options would be:
    Code:
    <option value="/Shopping/StoreGif/T-Black.jpg">Black</option>
    So on submit, the "/Shopping/StoreGif/T-Black.jpg" is passed on as the value (and in turn displayed as text in the shopping cart). I want the word "Black" to be displayed in the cart.

    Thank you!

  2. #2
    SitePoint Addict Resident Evil's Avatar
    Join Date
    May 2003
    Location
    Barrow
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <option name="/Shopping/StoreGif/T-Black.jpg" value='1'>Black</option>
    Like That?

  3. #3
    SitePoint Addict Resident Evil's Avatar
    Join Date
    May 2003
    Location
    Barrow
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry

    Code:
    <option name="Black" value="/Shopping/StoreGif/T-Black.jpg">Black</option>
    there that should do it?

  4. #4
    SitePoint Zealot frosco's Avatar
    Join Date
    Jul 2003
    Location
    WA state
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the ideas -- I figured it out. The javascript was using "value" to identify what picture to show, so I just changed the path field to value1 and pointed the js that direction, which left the "value" variable open to pass on with the form data.

    Thanks!


Bookmarks

Posting Permissions

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