Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Window Post back to original Form

Posted on 2000-02-21
7
Medium Priority
?
164 Views
Last Modified: 2013-12-24
Does anyone know how to launch a new window/Form and post back to the originating Window on submit using radio buttons.
0
Comment
Question by:fredphillippi
[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
7 Comments
 
LVL 5

Expert Comment

by:nathans
ID: 2543818
There are two ways depending on which one you want I can get into more detail.

1. Set session varibles
2. Use JavaScript

Maybe someone else knows of more ways.
0
 
LVL 4

Expert Comment

by:FRehman
ID: 2545212
use javscript
<Script language="JavaScript">
function displayHelp()
{
      helpWindow=window.open("Help.html", "Help", "toolbar=0,width=800,height=400,menubar=0,status=0,location=0,scrollbars=1,resizable=1,left=0,top=0,alwaysRaised=1");
}

</script>
0
 

Author Comment

by:fredphillippi
ID: 2545866
Thanks, I am close... See example.

I want to be able to send data from the opened (secondary) window back to the origniating window using radio buttons in a Form on the secondary window.

Here is an example using a dropdown menu. Help me make this radio buttons insted of a dropdown menu.

EXAMPLE:
Main Window:

script language="JavaScript"><!--
function myopen() {
    popupWindow=open('multiple.htm','windowName','resizable=no,width=400,height=300');
    if (popupWindow.opener == null) popupWindow.opener = self;
}
//--></script>

<form>
<input type="text" size="40" name="resultfield">
<input type="button" value="Open" onClick="myopen()">
</form>



And then in multiple.htm:

<script language="JavaScript"><!--
function update() {
    var output = '';

    for (var i=0;i < document.forms[0].selectfield.options.length;i++) {
         if (document.forms[0].selectfield.options[i].selected) {
             output += document.forms[0].selectfield.options[i].text + ' ';
         }
     }

    opener.document.forms[0].resultfield.value = output;
    window.close();
}
//--></script>

<form onSubmit="return false">
<select multiple name="selectfield">
<option>Monday
<option>Tuesday
<option>Wednesday
<option>Thursday
<option>Friday
<option>Saturday
<option>Sunday
</select>
<p>
<input type="button" value="Update" onClick="update()">
</form>

 





0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 5

Accepted Solution

by:
nathans earned 200 total points
ID: 2546135
<script language="JavaScript"><!--
function update(theRadio) {
   opener.document.forms[0].resultfield.value = theRadio.value;
   window.close();
}
//--></script>
<form onSubmit="return false">
<INPUT onClick="update(this)" TYPE="radio" NAME="day" VALUE="Monday">Monday
<INPUT onClick="update(this)" TYPE="radio" NAME="day" VALUE="Tuesday">Tuesday  
<INPUT onClick="update(this)" TYPE="radio" NAME="day" VALUE="Wednesday">Wednesday
<INPUT onClick="update(this)" TYPE="radio" NAME="day" VALUE="Thursday">Thursday
<INPUT onClick="update(this)" TYPE="radio" NAME="day" VALUE="Friday">Friday
<INPUT onClick="update(this)" TYPE="radio" NAME="day" VALUE="Saturday">Saturday
<INPUT onClick="update(this)" TYPE="radio" NAME="day" VALUE="Sunday">Sunday
</form>


OR

instead of the select just have your radio buttons like so:
<form name="days" onSubmit="return false">
<input type="Radio" name="day" value="Monday">Monday
<input type="Radio" name="day" value="Tuesday">Tuesday
<input type="Radio" name="day" value="Wednesday">Wednesday
<input type="Radio" name="day" value="Thursday">Thursday
<input type="Radio" name="day" value="Friday">Friday
<input type="Radio" name="day" value="Saturday">Saturday
<input type="Radio" name="day" value="Sunday">Sunday
<input type="button" value="Update" onClick="update()">
</form>

<script language="JavaScript"><!--
function update() {
    var output = '';
for (var i in document..musicType) {
   if (document.days.day[i].checked=="1") {         output+=document.days.day[i].value
   }    
}
    window.close();
}
//--></script>
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 2546160
nathans: thanx for posting my answer to your question here as the answer :-)
but there is an error:
the line:
>for (var i in document..musicType)
needs to be
for (var i in document.days.day)

CJ
0
 
LVL 5

Expert Comment

by:nathans
ID: 2546190
Your welcome...
0
 

Author Comment

by:fredphillippi
ID: 2548526
That worked!  Thanks!
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

610 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