SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Focus at the end of the textarea

    Hi i am inserting values in <textarea> using javascript . By default its focus on the top of the very first row but i want to give focus at the end of the row. Is it possible to focus at the end of the textarea... <textarea id=text1 name=text1 cols=40 rows=5 readonly onFocus="putthevaluehere()" ></textarea>
    <script>
    function putthevaluehere()
    {
    document.getElementById("text1").value = Msg;
    }
    </script>

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    textarea

    If the textarea is 20 cols wide and 5 rows high but empty, I don't think you can insert text at the bottom right corner. You could get the contents of the textarea and append to the end of the content, but you would have to make the contents of the textarea 100 empty spaces to get the script to append at the bottom right corner.

  3. #3
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No guys not that , i am able to append text in textarea but if suppose my textarea's content goes up and scrollbar appear, then its focus on the top of the row but i want to give focus at the bottom of the row....

    i think this time its clear...


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
  •