Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: Textfields

  1. #1
    Regular Coder
    Join Date
    May 2011
    Posts
    357
    Thanks
    23
    Thanked 1 Time in 1 Post

    Textfields

    SO if you have a text field and a function that adds sentences to it. WHen they get bigger than the text field it makes it have a scroll bar. BUt it always starts at the top(the scroll bar of the text field). Is there a way to keep the scroll bar at the bottom so your always looking at the new text.

  • #2
    Regular Coder
    Join Date
    May 2011
    Posts
    357
    Thanks
    23
    Thanked 1 Time in 1 Post
    anyone

  • #3
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    I think a <textarea> would be a great solution to your problem!
    http://www.w3schools.com/tags/tag_textarea.asp

    Quote Originally Posted by sherlockturtle View Post
    WHen they get bigger than the text field it makes it have a scroll bar.
    That's what a textarea is!

    Quote Originally Posted by sherlockturtle View Post
    BUt it always starts at the top(the scroll bar of the text field). Is there a way to keep the scroll bar at the bottom so your always looking at the new text.
    Maybe you could post a picture, so we can better understand what the problem is!
    here's a <textarea>, if you could open this up in paint and draw where the problem is, that would be great!
    Last edited by Sammy12; 11-23-2011 at 02:27 AM.

  • #4
    Regular Coder
    Join Date
    Jun 2005
    Posts
    153
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Yeah, <textarea> will make your life nice.

  • #5
    Regular Coder
    Join Date
    May 2011
    Posts
    357
    Thanks
    23
    Thanked 1 Time in 1 Post
    ohh sorry i meant a text area

  • #6
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    an image of the problem you are having would be great!

  • #7
    Regular Coder
    Join Date
    May 2011
    Posts
    357
    Thanks
    23
    Thanked 1 Time in 1 Post
    Its hard do show with an image but the problem is theres a text area and a function that adds an sentence. But when the sentance is added it does not scroll to the bottom of the textarea it stays at the top.

  • #8
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    I don't think it can be done in CSS, since html doesn't parse within a textarea, so the usual css jump with ids doesn't work!
    If I'm not mistaken there isn't a way to do this in javascript, but I actually can't say, since I never had to do this type of stuff, css jumps were the best solution.

    Try posting this in the javascript forum, or maybe the admins/mods will move the thread!

    EDIT: maybe if the textarea was initially in a div, then swapped into a textarea once the id was found?
    Last edited by Sammy12; 11-23-2011 at 04:32 AM.

  • #9
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,718
    Thanks
    41
    Thanked 191 Times in 190 Posts
    would also be helpful to see the script that is writing to the textarea

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE


  •  

    Posting Permissions

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