470,594 Members | 1,401 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

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

Jul 20 '05 #1
1 39361
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" <te***************@fastmail.fm> wrote in message
news:3f*********************@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

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Dan | last post: by
2 posts views Thread by Yoshitha | last post: by
5 posts views Thread by Vigneshwar Pilli via DotNetMonster.com | last post: by
3 posts views Thread by John Walker | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.