Solved

Window Post back to original Form

Posted on 2000-02-21
7
162 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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 
LVL 5

Accepted Solution

by:
nathans earned 50 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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