473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

new window has info from form in parent window

i have a form that contains values that i want to be written to a new
printable window on submit...
can anyone help me???
thanks,
woody

Jul 23 '05 #1
2 1167
This seems to be working for me.

================================
// 11-28-04 - one thing I hate is when I write a long email using a
service like Hotmail, then
// I hit submit, and then I lose everything I wrote because while I
was writing the email
// I unknowingly lost my internet connection. So now we are
offering this mild protection,
// which is to gather the text of the form and output it to t
separate window.

function openInNewWindowString(windowText) {
var docWindow = window.open('', 'userSubmission',
'width=300,height=300,status=true,scrollbars=true, resizable=true,toolbar=true');
docWindow.document.write(windowText);
docWindow.focus();
return false;
}

function saveYourWork() {
var elem = document.forms[0].elements,
temp = ['<h1>Please save your work!!!<\/h1>'];

for(var i = 0, n = elem.length; i < n; ++i) {
temp[temp.length] = elem[i].name;
temp[temp.length] = ': ';
temp[temp.length] = elem[i].value;
temp[temp.length] = '<hr>';
}
openInNewWindowString(temp.join(''));
}

Jul 23 '05 #2
thanks, i tryed this and this seems easier...

function showIt(){
window.open('print.html')}

<form name="form1" action="javascript:showIt()">
<input type="text" name="monday" size="105" readonly>
<input type="text" name="tuesday" size="105" readonly>

....
</form>

print.html looks like:

<script language="javascript">
document.write(opener.document.form1.monday.value)
</script>

<script language="javascript">
document.write(opener.document.form1.tuesday.value )
</script>
that will show the parent window's value of the form in the child
window (print.html)

thanks all!

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mark | last post by:
Any suggestions on how to go about generating a popup, giving the user a way of searching for something, and then taking their selection after closing the pop-up and populating the parent form with...
4
by: Earl Teigrob | last post by:
I am thinking about using a popup window to edit settings that will affect parent asp.net page. The data that is changed in the popup window will be saved to the datastore that is loaded and...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
4
by: Blaine | last post by:
Does anyone know how I can hide a form from the TaskManager? I've set the ShowInTaskbar to False, but when using Alt-TAB to switch between applications, it appears as a blank icon. I can set it...
0
by: kloplop321 | last post by:
I found this code(vb only) and it does about the same thing(in vb, not vb .NET 2005) Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.