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
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

[!--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
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

[!--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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.