473,508 Members | 4,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.scan.forms is null or not an object..?

<script language="javascript" src="/inc/js_popup_window.js"
type="text/javascript"></script>

<script language =" JavaScript" type="text/javascript">
function openScanWindow () {
NewWindow("scanning.htm", "scan", 500, 400, "yes") }
function updatestats (icount,smessage,iupdate,tcount) {
var objscan = window['scan'].forms['form1'] ;
if (iupdate == "doc") {
objscan.getElementById("docstats").value = icount ;
}
if (iupdate == "fld") {
objscan.getElementById("fldstats").value = icount ;
}
objscan.getElementById("mess").value=smessage;
objscan.getElementById("total").value=tcount;
}
</script>
<body >
<script language =" JavaScript" type="text/javascript">openScanWindow()
</script><h1>Bulk Transfer</h1><script language =" JavaScript"
type="text/javascript">updatestats (1,"[root of test folders]","doc",1)
</script>

'scanning.htm' form:
<form id = "form1" name = "form1">

<p><input type = "text" id = "docstats" name = "docstats" value = ""
style = "background-color: white;border:1px white solid; width:30px"
readonly />
documents scanned
<input type = "text" id = "fldstats" name = "fldstats" value = "" style =
"background-color: white;border:1px white solid; width:30px;margin-
left:20px" readonly />
folders scanned</p> <p>total =
<input type = "text" id = "total" name = "total" value = "" style =
"background-color: white;border:1px white solid; width:60px" readonly />
</p>
<p>Scanning<br />
<textarea name="mess" cols="100" rows="2" readonly="readonly"
wrap="VIRTUAL" id="mess" style="background-color: white;border:1px white
solid; width:400px"></textarea>
</p>
</form>
this generates a popup window containing form1, which is used to give a
'live' feed of info from the 'updatestats()' function.

This was working fine when on the same page but now in a popup I get the
above error. Something amiss with the objscan bit, but what?
Jul 23 '05 #1
2 1869
Lee
s_m_b said:

<script language="javascript" src="/inc/js_popup_window.js"
type="text/javascript"></script>

<script language =" JavaScript" type="text/javascript">
function openScanWindow () {
NewWindow("scanning.htm", "scan", 500, 400, "yes") }
function updatestats (icount,smessage,iupdate,tcount) {
var objscan = window['scan'].forms['form1'] ;

this generates a popup window containing form1, which is used to give a
'live' feed of info from the 'updatestats()' function.

This was working fine when on the same page but now in a popup I get the
above error. Something amiss with the objscan bit, but what?

You can't refer to a window by name. You need to use the
Window object that was returned by the window.open() method:

var myWindow=window.open("scanning.htm",
"scan",
"width=500,height=400,resizable,scrollbars");
var objscan=myWindow.document.forms["form1"];

Also, note that it takes an unknown amount of time for the new
window to open and for scanning.htm to download and be rendered,
and the window.open() call won't wait for all of that to happen
before passing control on to the next statement, which requires
that the form already exist. It would be better to have your
scanning.htm file contain code that calls a function in the
opener window to let it know that it's ready.

Jul 23 '05 #2
Lee <RE**************@cox.net> wrote in
news:db*********@drn.newsguy.com:
s_m_b said:

<script language="javascript" src="/inc/js_popup_window.js"
type="text/javascript"></script>

<script language =" JavaScript" type="text/javascript">
function openScanWindow () {
NewWindow("scanning.htm", "scan", 500, 400, "yes")
}
function updatestats (icount,smessage,iupdate,tcount) {
var objscan = window['scan'].forms['form1'] ;

this generates a popup window containing form1, which is used to give
a 'live' feed of info from the 'updatestats()' function.

This was working fine when on the same page but now in a popup I get
the above error. Something amiss with the objscan bit, but what?

You can't refer to a window by name. You need to use the
Window object that was returned by the window.open() method:

var myWindow=window.open("scanning.htm",
"scan",
"width=500,height=400,resizable,scrollbars")
;
var objscan=myWindow.document.forms["form1"];

Also, note that it takes an unknown amount of time for the new
window to open and for scanning.htm to download and be rendered,
and the window.open() call won't wait for all of that to happen
before passing control on to the next statement, which requires
that the form already exist. It would be better to have your
scanning.htm file contain code that calls a function in the
opener window to let it know that it's ready.

ah - should have thought of that. Not sure about how to do the function
to hold the rest of the page though.
Jul 23 '05 #3

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

Similar topics

3
5880
by: Marcus | last post by:
Hi I have a very complex sql query and a explain plan. I found there is a full table scan in ID=9 9 8 TABLE ACCESS (FULL) OF 'F_LOTTXNHIST' (Cost=84573 Card=185892...
1
1680
by: Mel | last post by:
i have popup window that maybe covered by other windows or minimized how can i use javascript to check for existence of a window named "AAA" and if exist open and raise it to the top of the...
5
60663
by: VR | last post by:
Hi, How can I open a web site in a new browser window from a regular windows form? (not an ASP.NET) Do I have to use a COM ActiveX control or is there anything like that already built in in...
8
7574
by: Shamrokk | last post by:
My application has a loop that needs to run every 2 seconds or so. To acomplish this I used... "Thread.Sleep(2000);" When I run the program it runs fine. Once I press the button that starts the...
3
5601
by: James Spibey | last post by:
Hi, I have an MDI application which has aboout 10 child windows. The way the app needs to work is that only one window should be visible at a time and it should be maximized within the parent...
8
11498
by: Mészáros Tamás | last post by:
Hi all, how can I set an app's main window to visible from an other application? My problem is, that I know only the handle of the other app's main process, because the application's main window...
1
5482
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the...
1
8582
by: Flack | last post by:
Hey guys, Here is whats happening. I have a StringBuilder, a TextBox, and a TabControl with one TabPage. On my main form, I created and displayed a fairly big maze. While the app is solving...
26
5634
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
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,...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5057
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
3206
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
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.