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 Coder
    Join Date
    Jan 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to access selections from combo box?

    I wonder if anyone can help me with this. I have a combo box on my page just like this one http://javascript.internet.com/forms...swapper-2.html

    But, I don't know how to access the selections a user might make. Does anyone know how to do this?

    thanskmuch

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    A couple of options here


    In the opening tag

    onchange="options[selectedIndex].value"

    Scriptwise

    document.formname.selectname.options[document.formname.selectname.selectedIndex].value;
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New Coder
    Join Date
    Jan 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for helping.

    In my particular version the combo box opens in a new <div> layer because it has many options and each option is pretty long (so it wouldn't look good if just left on the main page.)

    I have a SAVE button which selects the added options (the ones the user has put into the right hand <select>) and what I want it to do is have a script write the text of the selections into a <textarea> on the main page.

    My problem is, right now my SAVE button appends the index of the selections to the url, for instance, like this
    http://www.mypage.com?list2=1&list2=4

    (list2 being the right hand <select> box in the combo.)

    AS you can see, it works in that it gives me the index of the selections, but what I have no clue about is how do I get at those values in the url.

    Is there a way to access those values in the URL? (so that the associated text can be written into a textarea)

    thanks for help.

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Take a look here for information about transfering data to another page, this might help you.

    http://www.huntingground.freeserve.c...ta/p_data1.htm
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.


  •  

    Posting Permissions

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