SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Zealot maxdream01's Avatar
    Join Date
    Feb 2011
    Location
    USA
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    scroll to bottom of textarea

    ok so i have a textarea which is constantly being added to from a text file with the php include command. that textarea is in one .php file which is also being constantly refreshed every 20 seconds. another page on the site is showing this textarea with an iframe (no scroll). what i want is that after each refresh the scroller in the textarea automatically goes to the bottom of the textarea.

    ive tried to search this but nothing seems to work i also tried to use this

    textareaname.scrollTop = textareaname.scrollHeight;

    but im not sure how that fits into my page and if it even works

    also i found this

    <textarea id="ta">___</textarea>
    <script type="text/javascript">
    function f(ta_id){
    var d=document, ta, rng;
    if(d.all){
    ta=d.all[ta_id];
    if(ta && ta.createTextRange){
    rng=ta.createTextRange();
    rng.collapse(false);
    rng.select();
    }
    }
    }

    f('ta');
    </script>
    but it only works in ie

    thanks
    Last edited by maxdream01; May 1, 2011 at 08:37. Reason: more information


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •