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
Solved

list box?

Posted on 2001-06-05
4
139 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
  • 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

856 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