Passing Drop Down List Selected Value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • maflu

    Passing Drop Down List Selected Value

    Hello,
    I am rather a beginner in Javascript and have the following problem.
    There is a drop down list on my Web page with various values to be
    selected by the user. Once the user has selected a value, he/she clicks
    on the submit button. When he/she does that I would like 2 things to
    happen: the selected value of the drop down list is passed to another
    html page which opens in a new brower window open.

    Could you please help me do write that?

    Thank you :-)

    Cheers

  • Mike

    #2
    Re: Passing Drop Down List Selected Value

    An easy solution (for IE anyway not sure if it works in Mozilla) is to
    simply open up the new window and load the html page and then in the onLoad
    event handler reference the value of the select in the original window using
    the window.opener attribute.

    --orginal html

    <html>
    <head>
    <script>
    ...code to open new window here...
    </script>
    </head>
    <body>
    <select id="mySelect">< option value =1 selected>Option 1</select>
    </body>
    </html>

    --html in new window
    <html>
    <head>
    <script>
    function getSelectValue( ){
    alert(window.op ener.document.g etElementById(" mySelect").valu e);
    }
    </script>
    </head>
    <body onLoad="getSele ctValue()">
    </body>
    </html>


    Regards
    Mike

    "maflu" <teddymaflu_nos pam@fastmail.fm > wrote in message
    news:3fba5dfb$0 $228$636a55ce@n ews.free.fr...[color=blue]
    > Hello,
    > I am rather a beginner in Javascript and have the following problem.
    > There is a drop down list on my Web page with various values to be
    > selected by the user. Once the user has selected a value, he/she clicks
    > on the submit button. When he/she does that I would like 2 things to
    > happen: the selected value of the drop down list is passed to another
    > html page which opens in a new brower window open.
    >
    > Could you please help me do write that?
    >
    > Thank you :-)
    >
    > Cheers
    >[/color]


    Comment

    Working...