?
Solved

Window Post back to original Form

Posted on 2000-02-21
7
Medium Priority
?
163 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
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

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

777 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