473,756 Members | 2,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change height of textarea field in nested frame

31 New Member
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.
Nov 11 '08 #1
10 3444
waltapp
31 New Member
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?
Nov 11 '08 #2
waltapp
31 New Member
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.
Nov 11 '08 #3
waltapp
31 New Member
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.
Nov 11 '08 #4
waltapp
31 New Member
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3.  
  4. <title>Web Design Demo Control Buttons</title>
  5. <link href="title.css" rel="stylesheet" type="text/css" />
  6.  
  7. <script  src=""  type="text/javascript"></script>
  8.  
  9. <script type="text/javascript">
  10.  
  11.     function showPreview(){        
  12.         top.document.getElementById("demo").rows="100,*,1"
  13.         }
  14.  
  15.     function showCode(){
  16.         top.document.getElementById("demo").rows="100,1,*"
  17.         top.frames[0].frames[1].document.forms[0].getElementById("inputcss").style.height="300px"
  18.         }
  19.     function showBoth(){
  20.         top.document.getElementById("demo").rows="100,210,*"    
  21.         }        
  22. </script>
  23.  
  24.  
  25. </head>
  26.  
  27. <body>
  28. <form name="control" id="control" action="">
  29.  
  30. <h2 id="demotitle">Creating Web Pages</h2>
  31. <p>
  32.    <input type="button" value="Submit Code" onclick='sendCode()' >
  33.    <input type="button" value="Show Only Code" onclick='showCode()' >
  34.    <input type="button" value="Show Only Preview" onclick='showPreview()' >
  35.    <input type="button" value="Show Code and Preview" onclick='showBoth()' >
  36. </p>
  37. </form>
  38. </body>
  39. </html>
  40.  
Nov 11 '08 #5
waltapp
31 New Member
I am having trouble with line 17. I do not know how to properly move through the DOM to change this parameter.
Nov 11 '08 #6
waltapp
31 New Member
The code from frame 2 is from the demo.html page. Here is the code from the demo.html page.
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3.  
  4.  
  5. <title>HTML Demo</title>
  6. </head>
  7.  
  8. <frameset rows="100,210,*" id="demo" name="demo"> 
  9.    <frame name="title" id="title" src="title.html" scrolling="no" />
  10.    <frameset cols="*,*">
  11.       <frame name="code1" id="code1" src="html.html" />
  12.       <frame name="code2" id="code2" src="css.html" />
  13.    </frameset>
  14.    <frame name="output" id="output" />
  15. </frameset>
  16.  
  17. </html>
Nov 11 '08 #7
waltapp
31 New Member
Here is the code from the css.html page.
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3.  
  4. <title>CSS Code for the Demo Page</title>
  5. <link href="code.css" rel="stylesheet" type="text/css" />
  6. </head>
  7. <body>
  8. <form name="code" id="code" action="">
  9. <p>
  10. &lt;style type="text/css" &gt;
  11. <textarea id="inputcss" name="inputcss"></textarea>
  12. &lt;/style&gt;
  13. </p>
  14. </form>
  15. </body>
  16. </html>
Nov 11 '08 #8
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.
Nov 12 '08 #9
acoder
16,027 Recognized Expert Moderator MVP
Read this article on frames. It should help solve your problem.
Nov 12 '08 #10

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

Similar topics

4
9328
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...
2
5306
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'>
4
2635
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...
3
6784
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
4
4261
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 ?
3
12745
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
2
2061
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....
2
2310
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
3
1862
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,
0
9431
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, 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...
0
10014
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, 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...
0
9844
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 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...
1
9819
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,...
0
9689
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 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...
1
7226
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 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...
0
6514
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();...
1
3780
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
2
3326
muto222
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.