Scrolling

Discussion in 'Javascript' started by K., Nov 16, 2006.

  1. K.

    K. Guest

    Hi!

    I have such code:

    <textarea name="text_field">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
     
    K., Nov 16, 2006
    #1
    1. Advertisements

  2. K.

    K. Guest

    U¿ytkownik "Andrew C" <> napisa³ w wiadomo¶ci
    news:SGU6h.39505$...
    >
    > "K." <> wrote in message
    > news:ejh3j4$nup$...
    >> Hi!
    >>
    >> I have such code:
    >>
    >> <textarea name="text_field">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 longStringElement = getElementById("longString");
    > ...
    >
    > // Whenever you want the textarea to be scrolled to the bottom, do this:
    > longStringElement.scrollTop = longStringElement.scrollHeight;
    > </script>
    > ...
    > <textarea id="longString"...> ... </textarea>
    >
    > A.
    >
    >



    Hi again!

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

    <script language=JavaScript>

    var biografiaElement = document.getElementById("biografia");
    var utworyElement = document.getElementById("utwory");

    alert(biografiaElement.scrollHeight);

    biografiaElement.scrollTop = biografiaElement.scrollHeight;
    utworyElement.scrollTop = utworyElement.scrollHeight;
    </script>

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

    Please help me.
    Thank you in advance
    Marcin
     
    K., Nov 16, 2006
    #2
    1. Advertisements

  3. K.

    K. Guest

    U¿ytkownik "Andrew C" <> napisa³ w wiadomo¶ci
    news:plW6h.32995$...
    >
    > "K." <> wrote in message
    > news:ejh64e$u6f$...
    >>
    >> U¿ytkownik "Andrew C" <> napisa³ w wiadomo¶ci
    >> news:SGU6h.39505$...
    >>>
    >>> "K." <> wrote in message
    >>> news:ejh3j4$nup$...
    >>>> Hi!
    >>>>
    >>>> I have such code:
    >>>>
    >>>> <textarea name="text_field">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 longStringElement = getElementById("longString");
    >>> ...
    >>>
    >>> // Whenever you want the textarea to be scrolled to the bottom, do this:
    >>> longStringElement.scrollTop = longStringElement.scrollHeight;
    >>> </script>
    >>> ...
    >>> <textarea id="longString"...> ... </textarea>
    >>>
    >>> A.
    >>>
    >>>

    >>
    >>
    >> Hi again!
    >>
    >> Unfortunately this example doesn`t work on IE.
    >> I have created such code:
    >>
    >> <script language=JavaScript>
    >>
    >> var biografiaElement = document.getElementById("biografia");
    >> var utworyElement = document.getElementById("utwory");
    >>
    >> alert(biografiaElement.scrollHeight);
    >>
    >> biografiaElement.scrollTop = biografiaElement.scrollHeight;
    >> utworyElement.scrollTop = utworyElement.scrollHeight;
    >> </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.getElementById("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
     
    K., Nov 16, 2006
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert

    Connect Panel Scrolling

    Robert, Jul 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    425
    Robert
    Jul 22, 2003
  2. Ray Dixon [MVP]

    Re: Page scrolling

    Ray Dixon [MVP], Jul 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    648
  3. abacnet

    Datagrid header and scrolling,

    abacnet, Aug 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,220
    Saravana
    Aug 11, 2003
  4. Anwar

    Scrolling Text

    Anwar, Aug 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    606
    Anwar
    Aug 11, 2003
  5. sramruttun

    scrolling in popup form

    sramruttun, Aug 19, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    353
    Natty Gur
    Aug 20, 2003
  6. Tom Wild
    Replies:
    1
    Views:
    806
    Jerry III
    Aug 21, 2003
  7. Pradeep

    Scrolling functionality in Panel

    Pradeep, Aug 25, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    415
    Pradeep
    Aug 25, 2003
  8. Sam

    scrolling image

    Sam, Aug 29, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    674
    Vidar Petursson
    Aug 29, 2003
Loading...