473,790 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scrolling

K.
Hi!

I have such code:

<textarea name="text_fiel d">very long text</textarea>

I have filled in the value of textarea field. This value is a very long
string.
I would like to scroll this textarea field into the end.

Would you like to help me how to do that?

Thank you in advance
M. from Poland
Nov 16 '06 #1
5 1531

"K." <ha************ @poczta.onet.pl wrote in message
news:ej******** **@news.onet.pl ...
Hi!

I have such code:

<textarea name="text_fiel d">very long text</textarea>

I have filled in the value of textarea field. This value is a very long
string.
I would like to scroll this textarea field into the end.
<script ...>
var longStringEleme nt = getElementById( "longString ");
....

// Whenever you want the textarea to be scrolled to the bottom, do this:
longStringEleme nt.scrollTop = longStringEleme nt.scrollHeight ;
</script>
....
<textarea id="longString" ...... </textarea>

A.
Nov 16 '06 #2
K.

Użytkownik "Andrew C" <no******@total ly.made.upnapis ał w wiadomości
news:SG******** **********@news fe1-gui.ntli.net...
>
"K." <ha************ @poczta.onet.pl wrote in message
news:ej******** **@news.onet.pl ...
>Hi!

I have such code:

<textarea name="text_fiel d">very long text</textarea>

I have filled in the value of textarea field. This value is a very long
string.
I would like to scroll this textarea field into the end.

<script ...>
var longStringEleme nt = getElementById( "longString ");
...

// Whenever you want the textarea to be scrolled to the bottom, do this:
longStringEleme nt.scrollTop = longStringEleme nt.scrollHeight ;
</script>
...
<textarea id="longString" ...... </textarea>

A.


Hi again!

Unfortunately this example doesn`t work on IE.
I have created such code:

<script language=JavaSc ript>

var biografiaElemen t = document.getEle mentById("biogr afia");
var utworyElement = document.getEle mentById("utwor y");

alert(biografia Element.scrollH eight);

biografiaElemen t.scrollTop = biografiaElemen t.scrollHeight;
utworyElement.s crollTop = utworyElement.s crollHeight;
</script>

Alert gives me 0 height and I don`t know why...

Please help me.
Thank you in advance
Marcin
Nov 16 '06 #3

"K." <ha************ @poczta.onet.pl wrote in message
news:ej******** **@news.onet.pl ...
>
Użytkownik "Andrew C" <no******@total ly.made.upnapis ał w wiadomości
news:SG******** **********@news fe1-gui.ntli.net...
>>
"K." <ha************ @poczta.onet.pl wrote in message
news:ej******* ***@news.onet.p l...
>>Hi!

I have such code:

<textarea name="text_fiel d">very long text</textarea>

I have filled in the value of textarea field. This value is a very long
string.
I would like to scroll this textarea field into the end.

<script ...>
var longStringEleme nt = getElementById( "longString ");
...

// Whenever you want the textarea to be scrolled to the bottom, do this:
longStringElem ent.scrollTop = longStringEleme nt.scrollHeight ;
</script>
...
<textarea id="longString" ...... </textarea>

A.



Hi again!

Unfortunately this example doesn`t work on IE.
I have created such code:

<script language=JavaSc ript>

var biografiaElemen t = document.getEle mentById("biogr afia");
var utworyElement = document.getEle mentById("utwor y");

alert(biografia Element.scrollH eight);

biografiaElemen t.scrollTop = biografiaElemen t.scrollHeight;
utworyElement.s crollTop = utworyElement.s crollHeight;
</script>

Alert gives me 0 height and I don`t know why...

Please help me.
Thank you in advance
Marcin
Try:

<textarea id="biografia" readonly="true" ...>
....
</textarea>

A.
Nov 16 '06 #4
K.

Użytkownik "Andrew C" <no******@total ly.made.upnapis ał w wiadomości
news:Pl******** ***********@new sfe2-gui.ntli.net...
>
"K." <ha************ @poczta.onet.pl wrote in message
news:ej******** **@news.onet.pl ...
>>
Użytkownik "Andrew C" <no******@total ly.made.upnapis ał w wiadomości
news:SG******* ***********@new sfe1-gui.ntli.net...
>>>
"K." <ha************ @poczta.onet.pl wrote in message
news:ej****** ****@news.onet. pl...
Hi!

I have such code:

<textarea name="text_fiel d">very long text</textarea>

I have filled in the value of textarea field. This value is a very long
string.
I would like to scroll this textarea field into the end.

<script ...>
var longStringEleme nt = getElementById( "longString ");
...

// Whenever you want the textarea to be scrolled to the bottom, do this:
longStringEle ment.scrollTop = longStringEleme nt.scrollHeight ;
</script>
...
<textarea id="longString" ...... </textarea>

A.



Hi again!

Unfortunatel y this example doesn`t work on IE.
I have created such code:

<script language=JavaSc ript>

var biografiaElemen t = document.getEle mentById("biogr afia");
var utworyElement = document.getEle mentById("utwor y");

alert(biografi aElement.scroll Height);

biografiaElemen t.scrollTop = biografiaElemen t.scrollHeight;
utworyElement.s crollTop = utworyElement.s crollHeight;
</script>

Alert gives me 0 height and I don`t know why...

Please help me.
Thank you in advance
Marcin

Try:

<textarea id="biografia" readonly="true" ...>
...
</textarea>

A.
Unfortunately this example doesn`t give me a solution I would like to have.
I would like to have textarea element with updating possibilites.

I tried

var elem=document.g etElementById(" biografia");

if(elem)
{
elem.focus();
MoveToEnd(elem) ;
elem.focus();
}

but also without results.
I use IE 6.0.

Please help me, I cannot find any properly-working solution in post
archieves
Thank you Andrew for helping
Marcin
Nov 16 '06 #5

"K." <ha************ @poczta.onet.pl wrote in message
news:ej******** **@news.onet.pl ...
>
Użytkownik "Andrew C" <no******@total ly.made.upnapis ał w wiadomości
news:Pl******** ***********@new sfe2-gui.ntli.net...
>>
"K." <ha************ @poczta.onet.pl wrote in message
news:ej******* ***@news.onet.p l...
>>>
Użytkownik "Andrew C" <no******@total ly.made.upnapis ał w wiadomości
news:SG****** ************@ne wsfe1-gui.ntli.net...

"K." <ha************ @poczta.onet.pl wrote in message
news:ej***** *****@news.onet .pl...
Hi!
>
I have such code:
>
<textarea name="text_fiel d">very long text</textarea>
>
I have filled in the value of textarea field. This value is a very
long string.
I would like to scroll this textarea field into the end.

<script ...>
var longStringEleme nt = getElementById( "longString ");
...

// Whenever you want the textarea to be scrolled to the bottom, do
this:
longStringEl ement.scrollTop = longStringEleme nt.scrollHeight ;
</script>
...
<textarea id="longString" ...... </textarea>

A.


Hi again!

Unfortunate ly this example doesn`t work on IE.
I have created such code:

<script language=JavaSc ript>

var biografiaElemen t = document.getEle mentById("biogr afia");
var utworyElement = document.getEle mentById("utwor y");

alert(biograf iaElement.scrol lHeight);

biografiaElemen t.scrollTop = biografiaElemen t.scrollHeight;
utworyElement.s crollTop = utworyElement.s crollHeight;
</script>

Alert gives me 0 height and I don`t know why...

Please help me.
Thank you in advance
Marcin

Try:

<textarea id="biografia" readonly="true" ...>
...
</textarea>

A.

Unfortunately this example doesn`t give me a solution I would like to
have.
I would like to have textarea element with updating possibilites.

I tried

var elem=document.g etElementById(" biografia");

if(elem)
{
elem.focus();
MoveToEnd(elem) ;
elem.focus();
}

but also without results.
I use IE 6.0.

Please help me, I cannot find any properly-working solution in post
archieves
Thank you Andrew for helping
Marcin
If you need to add content to the textarea programmaticall y, readonly won't
stop you, but it does seem to allow the '...scrollTop = ...scrollHeight '
trick to work in IE -- at least it did in IE7 for me.

Only if you need for the user to add content via the keyboard will readonly
cause you difficulties. Even then, one work-around may be to switch readonly
off and on at different times (e.g. set readonly to true briefly when you
add content programmaticall y and need to auto-scroll to the bottom).

Does this help?

A.
Nov 16 '06 #6

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

Similar topics

1
16693
by: Midas NDT Sales | last post by:
I have been looking at a simple example of a scrolling text box (the one in the SAM book) as below: <script language="JavaScript"> var pos=100; function Scroll() { if (!document.getElementById) return; obj=document.getElementById("thetext"); pos -=1; if (pos < 0-obj.offsetHeight+130) return;
1
7025
by: Kirk | last post by:
Is it possible to stop horizontal scrolling whilst still maintaining vertical scrolling within an <IFRAME> ? Within each page of my site I have an IFRAME for content. For some pages there is very little information to display, thus the frame has no scrolling bars, but on those where there is lots then the vertical scrolling bar appears. However, on two of my pages the horizontal scrolling bar has appeared also - why!? I'm just...
44
919
by: Jim M | last post by:
I have had great success with using <iframe> with overflow-y set to auto. I can get a similar look with the <iframe> tag. BUT... In all cases I need to have fixed heights. Is there a way to put either tag inside an HTML <TD> and have the same kind of scrolling effect. This would allow me to fill the screen and have the size of the scrolling box change on resize. Thanks in advance.
1
2176
by: Tim Frawley | last post by:
I have a large form with many controls, almost like legal size paper in height. Just so I can head these off, I am not looking for suggestions to the effect of using Tab controls, multi-window or multi-page forms. The Forms AutoScroll property is set to true so the user can scroll the window. What I would like to do is scroll the form for the user. I have explored the possibility of Me.ScrollControlIntoView(control further
2
2977
by: P2P | last post by:
Hi I am wondering if someone know of a free cross-browsers vertical scrolling script that - is cross cross-browsers - will call the scrolling content from an external html page or from a url page
4
7808
by: Keith Bentrup | last post by:
Hi all, I wrote a simple search function to find text in a textarea where not all the text is visible (ie. the text box displays 10 lines but there may be more than 1000 lines to search). I can find the text and select it using the function below, BUT I can't figure out how to have the textarea automatically scroll to the selection in Firefox. Any ideas or suggestions? function search(needle,haystack,start) { var element =...
1
1852
by: atif | last post by:
Hi, I m new to CSharp.. so may be my preliminary questions look stupid.. but plz help me.. I want to drag controls like buttons or some other user controls over form.. i have set form's autoscroll = true to handle scrolling automatically. but when i drag the components of form, scrolling occurs extra ordinary too fast.. so plz help me to control scrolling as in visual studion designer.. as we
5
4269
by: PythonistL | last post by:
I am a newbie with Javascript. I have this simple script for scrolling text <HTML> <HEAD> <TITLE>Scrolling Message Script</TITLE> <SCRIPT language="JavaScript"><!-- var msg = 'My scrolling text.. ' function scrollMsg(){
3
11758
by: Chamnap | last post by:
Hello everybody, I have one problem. I want to do something after the user finished scrolling. The scroll event fires whenever the user is scrolling. I don't want this actually. Does anyone has any idea or trick of how to achieve this? Appreciate your ideas..... Thanks Chamnap
0
9512
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
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...
0
9986
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...
0
9021
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
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
6769
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();...
0
5422
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2909
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.