Hello, I am a new programmer and I am working on a school project. I am being instructed to move up then down the dom. My parent is demo.html then a frameset and then another frameset within the frameset. I have figured out how to get up to the parent and then down to the first frameset and change the rows attribute. However I am stuck on getting to the next level, I am required to change the height of the second frameset textarea to 300 pixels.
here is the code for the demo.html
[HTML]<html>
<head>
<!--
New Perspectives on JavaScript
Tutorial 6
Case Problem 3
Web Design Demo
Filename: demo.html
Supporting files: css.html, html.html, title.html
-->
<title>HTML Demo</title>
</head>
<frameset rows="100,210,* " id="demo" name="demo">
<frame name="title" id="title" src="title.html " scrolling="no" />
<frameset cols="*,*">
<frame name="code1" id="code1" src="html.html" />
<frame name="code2" id="code2" src="css.html" />
</frameset>
<frame name="output" id="output" />
</frameset>
</html>
here is the code for the title.html
<html>
<head>
<!--
New Perspectives on JavaScript
Tutorial 6
Case Problem 3
Web Design Demo Control Buttons
Author: Greg Funston
Date: November 9,2008
Filename: title.html
Supporting files: title.css
-->
<title>Web Design Demo Control Buttons</title>
<link href="title.css " rel="stylesheet " type="text/css" />
<script src="" type="text/javascript"></script>
<script type="text/javascript">
function showPreview(){
parent.document .getElementById ("demo").rows=" 100,*,1"
}
function showCode(){
parent.document .getElementById ("demo").rows=" 100,1,*"
parent.frames.d ocument.getElem entById("code1" ).textarea.styl e.height="300"
parent.frames.d ocument.getElem entById("code2" ).textarea.styl e.height="300"
}
function showBoth(){
parent.document .getElementById ("demo").rows=" 100,210,*"
}
</script>
*/
</head>
<body>
<form name="control" id="control" action="">
<h2 id="demotitle"> Creating Web Pages</h2>
<p>
<input type="button" value="Submit Code" onclick='sendCo de()' >
<input type="button" value="Show Only Code" onclick='showCo de()' >
<input type="button" value="Show Only Preview" onclick='showPr eview()' >
<input type="button" value="Show Code and Preview" onclick='showBo th()' >
</p>
</form>
</body>
</html>
[/HTML]
I would appreciate the help to find the problem with my code.
10 3444
I know my problem is in the line
parent.frames.d ocument.getElem entById("code1" ).textarea.styl e.height="300"
and the line below it is wrong also. What am I staing incorrectly?
I have a parent element with the following code:
[HTML]<html>
<head>
<title>HTML Demo</title>
</head>
<frameset rows="100,210,* " id="demo" name="demo">
<frame name="title" id="title" src="title.html " scrolling="no" />
<frameset cols="*,*">
<frame name="code1" id="code1" src="html.html" />
<frame name="code2" id="code2" src="css.html" />
</frameset>
<frame name="output" id="output" />
</frameset>
</html>
[/HTML]and I am required to go two levels down and make the textarea feilds height to 300 pixels. I am required to do this through a file called css.html.It is the second frame in the above code name="code2"
I am required to change this parameter in the frame name="title"
my code so far is:
[HTML]<html>
<head>
<title>Web Design Demo Control Buttons</title>
<link href="title.css " rel="stylesheet " type="text/css" />
<script src="" type="text/javascript"></script>
<script type="text/javascript">
function showPreview(){ top.document.ge tElementById("d emo").rows="100 ,*,1"
}
function showCode(){
top.document.ge tElementById("d emo").rows="100 ,1,*"
top.frames[1].frames[0].document.forms[0].getElementById ("inputcss").st yle.height=300
}
function showBoth(){
top.document.ge tElementById("d emo").rows="100 ,210,*"
}
</script>
*/
</head>
<body>
<form name="control" id="control" action="">
<h2 id="demotitle"> Creating Web Pages</h2>
<p>
<input type="button" value="Submit Code" onclick='sendCo de()' >
<input type="button" value="Show Only Code" onclick='showCo de()' >
<input type="button" value="Show Only Preview" onclick='showPr eview()' >
<input type="button" value="Show Code and Preview" onclick='showBo th()' >
</p>
</form>
</body>
</html>
[/HTML]
Can someone please help me understand my problem with this.
Hello, I need help to change the textarea height. I know how to do it if I could figure out how to use the DOM properly. I have a page named title.html and it has a parent named demo.html. The demo page has a frameset with another frameset nested within it.
This is where the css.html page opens. I need to access the attributes of the textarea object and change them. I would appreciate some help from anyone please. I have been working on this for many hours.
- <html>
-
<head>
-
-
<title>Web Design Demo Control Buttons</title>
-
<link href="title.css" rel="stylesheet" type="text/css" />
-
-
<script src="" type="text/javascript"></script>
-
-
<script type="text/javascript">
-
-
function showPreview(){
-
top.document.getElementById("demo").rows="100,*,1"
-
}
-
-
function showCode(){
-
top.document.getElementById("demo").rows="100,1,*"
-
top.frames[0].frames[1].document.forms[0].getElementById("inputcss").style.height="300px"
-
}
-
function showBoth(){
-
top.document.getElementById("demo").rows="100,210,*"
-
}
-
</script>
-
-
-
</head>
-
-
<body>
-
<form name="control" id="control" action="">
-
-
<h2 id="demotitle">Creating Web Pages</h2>
-
<p>
-
<input type="button" value="Submit Code" onclick='sendCode()' >
-
<input type="button" value="Show Only Code" onclick='showCode()' >
-
<input type="button" value="Show Only Preview" onclick='showPreview()' >
-
<input type="button" value="Show Code and Preview" onclick='showBoth()' >
-
</p>
-
</form>
-
</body>
-
</html>
-
I am having trouble with line 17. I do not know how to properly move through the DOM to change this parameter.
The code from frame 2 is from the demo.html page. Here is the code from the demo.html page. - <html>
-
<head>
-
-
-
<title>HTML Demo</title>
-
</head>
-
-
<frameset rows="100,210,*" id="demo" name="demo">
-
<frame name="title" id="title" src="title.html" scrolling="no" />
-
<frameset cols="*,*">
-
<frame name="code1" id="code1" src="html.html" />
-
<frame name="code2" id="code2" src="css.html" />
-
</frameset>
-
<frame name="output" id="output" />
-
</frameset>
-
-
</html>
Here is the code from the css.html page. - <html>
-
<head>
-
-
<title>CSS Code for the Demo Page</title>
-
<link href="code.css" rel="stylesheet" type="text/css" />
-
</head>
-
<body>
-
<form name="code" id="code" action="">
-
<p>
-
<style type="text/css" >
-
<textarea id="inputcss" name="inputcss"></textarea>
-
</style>
-
</p>
-
</form>
-
</body>
-
</html>
acoder 16,027
Recognized Expert Moderator MVP
I've merged three of your threads on the same topic. Please do not double post your questions.
Moderator.
acoder 16,027
Recognized Expert Moderator MVP
Read this article on frames. It should help solve your problem.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Doug van Vianen |
last post by:
Hi,
I am working on an Applet which provides some mouse practice for
new computer users in our local seniors' computer club. The applet
contains several cards, in a card layout, which are displayed to
the user one after the other as needed to present some particular
mouse operation. This all works fine. One card (card 4 below)
includes a textarea and a button. What I wish to do is have the user
use the mouse to select some text from the...
|
by: RWD |
last post by:
I am trying to figure out how to change the target frame in my hyperlink on
a DHTML menu. The menu is in one frame and the target frame is called
"main"
The code is below:
Thanks in advance
RWD
<script type='text/javascript'>
|
by: Richard Cornford |
last post by:
For the last couple of months I have been trying to get the next round
of updates to the FAQ underway and been being thwarted by a heavy
workload (the project I am working on has to be finished an QA tested
for a new year release. I don't think that going to prove practical, but
there is no harm in trying :) and some serious family commitments. But
it has to be done soon so this is stage one.
Mike Winter provided an extensive list of...
|
by: Jarek Mielcarek |
last post by:
hi all,
in xml file I have some fields which are source for <textarea> element.
I'd like to transform this file using xslt and set the rows property of
<textarea> depend of lines in some source field.
How to do this?
regards
jaro
|
by: TJS |
last post by:
can the rows and columns of a textarea element with an id be changed on the
fly ?
if so is there an example ?
| |
by: spielmann |
last post by:
Hello
I want to change the scrollbar size of windows, How can I do that with
vb.net
I have find this in VB6 but how can we convert simply this code.
thx
|
by: HopfZ |
last post by:
I am trying to make a bookmarklet to enlarge textarea in Gmail. But I
can't get to the textarea.
When you are composing a message in Gmail, the page has two frames. the
first frame has name "main". That frame contains a textarea named
"msgbody" in which you compose messages.
I have tried with Firebug getElementsByTagName and getElementsByName
but all fails.
self.main.document.getElementsByTagName('textarea') returns empty list....
|
by: Daniel Mark |
last post by:
Hello all:
I am using PIL to draw some graphics and I need to draw some texts
in vertical direction rather than the default left-to-right horizontal
direction.
Is there anyway I could do that?
Thank you
|
by: Charles |
last post by:
I am designing a small HTML editor, and in the lower pane, I want the
textarea to use 100% height with the toolbar, but no more than that:
http://www.auriance.com/docs/tmp/editor/
Actually it uses 100% + 25px of the toolbar, which means if you click
an icon of the toolbar, it disappears instantly. How could I solve it?
Also resizing the frames doesn't work properly in IE...
Thanks,
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |