Solved

Window Post back to original Form

Posted on 2000-02-21
7
157 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
7 Comments
 
LVL 5

Expert Comment

by:nathans
Comment Utility
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
Comment Utility
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
Comment Utility
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
Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

 
LVL 5

Accepted Solution

by:
nathans earned 50 total points
Comment Utility
<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
Comment Utility
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
Comment Utility
Your welcome...
0
 

Author Comment

by:fredphillippi
Comment Utility
That worked!  Thanks!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

11 Experts available now in Live!

Get 1:1 Help Now