473,473 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

form results in new window

4 New Member
I use this javascript code:

Expand|Select|Wrap|Line Numbers
  1. function displayAllResults(r) {
  2.     var t = "<h2>Result:<textarea name='resultsBox' style='background-color: #FFF8C6' rows='30' cols='35' readonly>"+r+"</textarea>&nbsp;<br></h2>";    document.getElementById(/*belowBoardCellName*/rightOfBoardCellName).innerHTML = t); 
  3.     }
  4.  
When the user clicks on a button called "All Results" a text called results "r" is displayed in a textbox of my HTML document. The result r text is in a MYSQL database and is called by a php script.

Everything works well, however I would like to display this box with the current result text in a new window, but was not able to do so.

Thanks in advance for any help.

AVF
Sep 4 '07 #1
6 2043
epots9
1,351 Recognized Expert Top Contributor
what is calling the function displayAllResults(r)? and what data is r holding?
Sep 4 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
Everything works well, however I would like to display this box with the current result text in a new window, but was not able to do so.
To open a new window, use the window.open() method. Keep a reference to the window so that you can access it. Show the code that you have tried.
Sep 4 '07 #3
AVF07
4 New Member
what is calling the function displayAllResults(r)? and what data is r holding?
Two function are calling displayAllResults(r), r holds varies text data in the database.

Expand|Select|Wrap|Line Numbers
  1. function transistionC() {
  2.     var r = "";
  3.     var tempR = "";
  4.     var rArr = new Array(0);
  5.     var isNew;
  6.     for(var row=0; row<NUM_OF_ROWS; row++) {
  7.         for(var col=0; col<NUM_OF_COLS/*allResults.length*/; col++) {
  8.             tempR = getResult(row, col, false); //shouldReturnSum = false, display the sum in seperately
  9.             isNew = true;
  10.             if(tempR.length > 0) {
  11.                     for(var i=0; i < rArr.length; i++) {
  12.                     if(tempR.search(rArr[i]) != -1) {
  13.                         isNew = false;
  14.                         break;
  15.                     }
  16.                 }
  17.                 if(isNew) {
  18.                     r = r + tempR + "\n\n"; 
  19.                     rArr[rArr.length] = tempR.substring(1,30);
  20.                 }
  21.             }
  22.         }
  23.     }
  24.  
  25.     var sumResult = parent.OracleData.getSumResult();
  26.     //alert(sumResult);
  27.     //alert("hello... in transistionC()");
  28.     r = "Results" + sumResult + "\n\n" + r;
  29.     displayAllResults(r);
  30.     //state is still results
  31. }
  32.  
  33. function transistionH() {
  34.     displayAllResults(r);
  35. }
Sep 4 '07 #4
AVF07
4 New Member
To open a new window, use the window.open() method. Keep a reference to the window so that you can access it. Show the code that you have tried.
I have tried:

Expand|Select|Wrap|Line Numbers
  1. function displayAllResults(r) {
  2.  
  3.     var t = "<h2>Result:<textarea name='resultsBox' style='background-color: #FFF8C6' rows='30' cols='35' readonly>"+r+"</textarea>&nbsp;<br></h2>";    document.getElementById(/*belowBoardCellName*/rightOfBoardCellName).innerHTML = t); 
  4.     }
Sep 4 '07 #5
AVF07
4 New Member
To open a new window, use the window.open() method. Keep a reference to the window so that you can access it. Show the code that you have tried.

I have tried onClick = window.open(); but I am not certain what to pu in paranthesis as I only want the textbox to open in a new window?

Expand|Select|Wrap|Line Numbers
  1. function displayAllResults(r) {
  2. onClick = window.open();
  3.     var t = "<h2>Result:<textarea name='resultsBox' style='background-color: #FFF8C6' rows='30' cols='35' readonly>"+r+"</textarea>&nbsp;<br></h2>";
  4.     document.getElementById(/*belowBoardCellName*/rightOfBoardCellName).innerHTML = t); 
  5.     }
Sep 4 '07 #6
acoder
16,027 Recognized Expert Moderator MVP
Please use CODE tags when posting code.

See this link (describes how to use window.open).

You have two options: either create a page which has the text box and then just change its value, or open a new document and write to it using document.write.
Sep 4 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steve | last post by:
I'm working in PHP, but am also using JavaScript, so perhaps there is a better way to do this using more PHP code...... I setup a search screen for my database, the user enters data and submits...
1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
2
by: Scott | last post by:
Hi, I hope someone might be able to set me straight on how to handle the situation described below. I have a page that has an email field for user input and 2 radio buttons (subscribe +...
4
by: Billy Boone | last post by:
I have a web form that allows the user to enter several pieces of information. They can then click to see the results (which takes them to a report form). From this form, if the user clicks the...
2
by: j.mandala | last post by:
This had got to be something obvious that I am too blind to see! Funny problem: one of my users has my application linked to a SQL Server Backend. Front end it Access XP (SP3). The first form...
4
by: Tony | last post by:
Hello, Using Access2000, WinNT. Using the Immediate Window, I can view the results of my VBA code as it performs operations/calculations on my data. Now that I have all the bugs worked out,...
2
by: tao lin | last post by:
Hi, all I am using VS2003 under WinXP. My WebApp has a WebForm which has a html form has some search condition textbox, once the user fill in the condition and click submit button. My app will...
4
by: sam | last post by:
hi, How to set constant focus on window form in c#. cheers Sam
2
by: Robert | last post by:
I am trying to give the user dynamic search capabilities to select almost any record in the database from criteria they select. Everything seems to work except when I open the display form to...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.