Solved

list box?

Posted on 2001-06-05
4
136 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

759 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now