Jump to content

Textfield/area - keep recent added text in view


redbullmarky

Recommended Posts

Hi all
Maybe a simple one:
I have a text field. Underneath the next field is a list of words. When you click on a word, it's added to the text field.
The problem is that once the text field is full, you cant see what's being added as the textfield doesnt automatically shift across.
Is there a way to automatically put the newly added text in view, just as if i was typing in the field itself?

Cheers
Mark
I dont know how to do it but I do know that you'll need to use a function called scrollTo which you can use to make the texbox scroll to the end when a word is inserted.

The syntax is like this:
[code]srollTo(x position, y position)[/code]
[!--quoteo(post=383208:date=Jun 13 2006, 12:38 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 13 2006, 12:38 PM) [snapback]383208[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I dont know how to do it but I do know that you'll need to use a function called scrollTo which you can use to make the texbox scroll to the end when a word is inserted.

The syntax is like this:
[code]srollTo(x position, y position)[/code]
[/quote]

Hi
I gave it a go, but unfortunately didnt work. The error returned in the Javascript Console was: el.scrollTo is not a function. It had no effect on the actual textfield at all. 'el' is define using document.getElementById('mytextfield')

Any other ideas?
Cheers
Mark
Oh crap I'm such a dumb-butt! I was supposed to type [b]scrollTo[/b] not srollTo

So yeah the function is:
[code]scrollTo(x position, y position);[/code]

Also you are using it on textarea (< textarea></textarea>) and not a text input field?
[!--quoteo(post=383391:date=Jun 13 2006, 07:04 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 13 2006, 07:04 PM) [snapback]383391[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Oh crap I'm such a dumb-butt! I was supposed to type [b]scrollTo[/b] not srollTo

So yeah the function is:
[code]scrollTo(x position, y position);[/code]

Also you are using it on textarea (< textarea></textarea>) and not a text input field?
[/quote]

i noticed the spelling bit :)
at the moment, i'm hoping to use it on a textfield, not a text area, although the text area option will come up later.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.