Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Passing Drop Down List Selected Value (http://www.velocityreviews.com/forums/t873941-passing-drop-down-list-selected-value.html)

maflu 11-18-2003 05:59 PM

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 11-20-2003 01:02 AM

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.opener.document.getElementById("mySel ect").value);
}
</script>
</head>
<body onLoad="getSelectValue()">
</body>
</html>


Regards
Mike

"maflu" <teddymaflu_nospam@fastmail.fm> wrote in message
news:3fba5dfb$0$228$636a55ce@news.free.fr...
> 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
>





All times are GMT. The time now is 08:23 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57