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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need to compare items in a drop down list.

    I want to compare items based on what the user picks there will be 3 drop down menus and the drop down menus should alter the HTML table each time it is changed, giving different option values and stuff. I am wondering how to go about this I have the basic stuff setup but I am not really sure how to add to a table that all 3 options use. Any help would be greatly appreciated.

    Here is my current code for the drop downs.

    Code:
    <form name="compare">
    <select name="compare">
    <option value="V1">Value 1</option>
    <option value="V2">Value 2</option>
    <option value="V3">Value 3</option>
    <option value="V4">Value 4</option>
    </select>
    <select name="compare2">
    <option value="V1">Value 1</option>
    <option value="V2">Value 2</option>
    <option value="V3">Value 3</option>
    <option value="V4">Value 4</option>
    </select>
    <select name="compare3">
    <option value="V1">Value 1</option>
    <option value="V2">Value 2</option>
    <option value="V3">Value 3</option>
    <option value="V4">Value 4</option>
    </select>
    <input type="button" onClick="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="Compare">
    </form>
    I want the user to select one of the options from above and a table to show up showing the differences between the others for example; someone selects Value 1 for compare, and Value 2 for compare 2, and Value 3 for Compare 3, they should be shown a table which has the differences between Value 1, Value 2, Value 3. So lets say Value 1 and Value 3 offers you "Help" while value 2 doesn't. it should show a table that says

    Features Value 1 Value 2 Value 3
    Help YES NO YES

    how would I go about doing this?

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,919
    Thanks
    79
    Thanked 4,423 Times in 4,388 Posts
    Where are you going to get the table of capabilities of the various values??

    That's the hardest part.

    And what about if the user chooses "Value 1" in all three <select>s?? Do you care about that?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Glad you understood the question, Old Pedant - more than I did!

  • #4
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry if I was confusing, I was kind of typing in a hurry.

    Ok, I'll give more details about this...

    I want to set a table up through PHP, I've just tried a few different methods, but they didn't work like I want them to, I had to keep refreshing the page.

    I don't want users to be able to select the same value on each comparison item, as other comparisons.

    For an example I posted Value 1 above...

    Ok I want the table to change or have it to where all I do is put some kind of variable in it where it has the table coding if someone changed it.

    Does that make more sense?

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,919
    Thanks
    79
    Thanked 4,423 Times in 4,388 Posts
    Quote Originally Posted by kuzco View Post
    Does that make more sense?
    No. Less sense.

    I don't understand any of that, except the part where you want to make sure 3 different options are chosen.

    I have no idea where the values that you want to display are supposed to come from.

    Maybe you need to show a real example????
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #6
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok here's an example of a site that does it.

    http://www.kia.com/#/compare/?page=M...Modes.overview

    You can select a car on there and then compare it to other cars.

    I want to have the same type of setup, but have it to where you select different things instead of cars.

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,919
    Thanks
    79
    Thanked 4,423 Times in 4,388 Posts
    Okay, so exactly what I said: *WHERE* will you get the data that you will be comparing?

    *PROBABLY* you don't want to go get that data until all the options have been selected. But that depends on how many items there are and how much data there is per item.

    There isn't any one-solution-fits-all here.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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