Solved

list box?

Posted on 2001-06-05
4
141 Views
Last Modified: 2010-04-09
Hi,
I want to launch a window from a page. This new page has a combo box. The initial page has an empty combo box. How can I place the selected option from the new page into the empty combo box of the original page!
Cheers
0
Comment
Question by:spunog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:edemcs
ID: 6156818
I believe you would have to use a Dynamic Language such as ASP or ColdFusion.
0
 
LVL 9

Accepted Solution

by:
nimaig earned 200 total points
ID: 6156886
/**************** save this as opened.html **********************/

<html>
<head>

<script language="JavaScript">
     function updateParent(currObj){
          if(opener){
               var value = currObj.options[currObj.selectedIndex].value;
               var text = currObj.options[currObj.selectedIndex].text;
               opener.addOption(text,value);
          }
     }
</script>
</head>
<body>
<form>
<select name="sel1" onChange="updateParent(this)">
<option value="1">One</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="4">four</option>
</select>

</form>
</body>
</html>

/***************** save this as test.html*******************/

<html>
<head>

<script language="JavaScript">
     function addOption(text,value){
          var obj = document.forms[0].sel1;
          obj.options[obj.length]=new Option(text,value);
     }
     function openChild(){
          window.open("opened.html");
     }
</script>
</head>
<body>
<form>
<select name="sel1">

</select>
<input type="button" onClick="openChild()" value="open">
</form>
</body>
</html>


/***************** and run test.html*******************/
0
 
LVL 8

Expert Comment

by:edemcs
ID: 6156944
I believe you would have to use a Dynamic Language such as ASP or ColdFusion.
0
 

Author Comment

by:spunog
ID: 6156977
Cheers, thats perfect !
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question