Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-22-2011, 04:49 PM   PM User | #1
sherlockturtle
Regular Coder

 
Join Date: May 2011
Posts: 357
Thanks: 23
Thanked 1 Time in 1 Post
sherlockturtle can only hope to improve
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.
sherlockturtle is offline   Reply With Quote
Old 11-23-2011, 01:27 AM   PM User | #2
sherlockturtle
Regular Coder

 
Join Date: May 2011
Posts: 357
Thanks: 23
Thanked 1 Time in 1 Post
sherlockturtle can only hope to improve
anyone
sherlockturtle is offline   Reply With Quote
Old 11-23-2011, 02:20 AM   PM User | #3
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
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..
Sammy12 is offline   Reply With Quote
Old 11-23-2011, 02:23 AM   PM User | #4
questionable
Regular Coder

 
Join Date: Jun 2005
Posts: 153
Thanks: 26
Thanked 0 Times in 0 Posts
questionable is an unknown quantity at this point
Yeah, <textarea> will make your life nice.
questionable is offline   Reply With Quote
Old 11-23-2011, 03:13 AM   PM User | #5
sherlockturtle
Regular Coder

 
Join Date: May 2011
Posts: 357
Thanks: 23
Thanked 1 Time in 1 Post
sherlockturtle can only hope to improve
ohh sorry i meant a text area
sherlockturtle is offline   Reply With Quote
Old 11-23-2011, 03:25 AM   PM User | #6
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
an image of the problem you are having would be great!
Sammy12 is offline   Reply With Quote
Old 11-23-2011, 03:35 AM   PM User | #7
sherlockturtle
Regular Coder

 
Join Date: May 2011
Posts: 357
Thanks: 23
Thanked 1 Time in 1 Post
sherlockturtle can only hope to improve
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.
sherlockturtle is offline   Reply With Quote
Old 11-23-2011, 04:28 AM   PM User | #8
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
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..
Sammy12 is offline   Reply With Quote
Old 11-23-2011, 02:19 PM   PM User | #9
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
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
alykins is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:45 PM.


Advertisement
Log in to turn off these ads.