Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Window.frames.count don't work!!

Posted on 2001-07-23
6
Medium Priority
?
950 Views
Last Modified: 2007-11-27
Why doesn't this piece of code work?

The ultimate aim is to get a value into the textbox on A_form-main from form-main

The error is Object does not support this property or method 'Window.frames.count'


Listing:form-main

<html>
<head>
<title>Welcome to RightFax
</title>

<body bgcolor=#FFFFFF>

<FRAMESET border="0" cols="25%, *">
  <FRAME src="A_form-main" NAME=RightFax_Main>
  <FRAME src="Test.asp">
</FRAMESET>

<SCRIPT LANGUAGE=VBScript>
<!--
msgbox Window.frames.count
-->
</SCRIPT>
</body>
</head>
</html>



Listing:test.asp

<%@LANGUAGE=VBScript%>

<%

If Request.ServerVariables("QUERY_STRING") <> "" then
    response.write "<html><head><title>A title</title><body>Clicked</body></head></html>"
else

%>

<html>
<head>
<title>A title</title>
<body>
<FORM METHOD=GET ID=Form1 NAME=Form1>
Body
<p NAME="P">P</P>
<INPUT TYPE=SUBMIT value="Hello">
<INPUT TYPE=TEXT value="MyText" NAME="Text1">
</FORM>
</body>
<%End If%>
</head>
</html>


A_form-main

<html>
<head>
<title>
RightFAX Main Menu
</title>
</head>

<body bgcolor=#FFFFFF>
<FORM>
<INPUT TYPE=TEXT NAME=UnreadFax>
</FORM>
</BODY>
</HTML>

0
Comment
Question by:andcu
[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
6 Comments
 
LVL 4

Expert Comment

by:jcs_clement
ID: 6308147
Well you can do this by using Javascript instead of VBScript on the client side.

<script language="javascript">
function fun(){
alert(window.frames.length)
}
<script>

<body OnLoad="fun()">


but remember that this is case sensitive :)

rgds
jcs
0
 
LVL 2

Accepted Solution

by:
DirkVe earned 200 total points
ID: 6308191
multiple problems:

1- You cannot add extra things (like text or code) in a page that defines the frames. A typical main frame looks like this:

<BODY>
<FRAMESET border="0" cols="25%, *">
 <FRAME src="frTest2.htm" NAME=RightFax_Main>
 <FRAME src="frTest2.htm" name="ikke">
</FRAMESET>
</BODY>

Any extra SCRIPT will not execute.

A solution is to write it in the BODY-ONLOAD.

2-
it's not
window.frames.count
BUT
window.frames.length

3- it will always return 0 because you're frames are not loaded yet (don't exist) when you load the 'main frame'.
0
 

Author Comment

by:andcu
ID: 6308205
More detail covered here.  I can't accept two answers unforunately!!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:jcs_clement
ID: 6310989
Hi buddy,

well you can do that. You will have to ask the help desk people to do it :-)

Desperate to earn points yeah !! :)

rgds
jcs
0
 
LVL 3

Expert Comment

by:modder
ID: 6312215
Hi andcu,

How would you like to split the points, 50/50?

modder
Community Support
0
 

Expert Comment

by:ComTech
ID: 6685651
Split was never completed, I will leave a question for jcs_clement in this Topic Area.

Best regards,
ComTech
Community Support
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

609 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