Jump to content


Photo

Textfield/area - keep recent added text in view


  • Please log in to reply
5 replies to this topic

#1 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 12 June 2006 - 01:09 PM

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
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 12 June 2006 - 09:20 PM

* bump * anyone?
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 13 June 2006 - 11:38 AM

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:
srollTo(x position, y position)


#4 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 13 June 2006 - 05:46 PM

[!--quoteo(post=383208:date=Jun 13 2006, 12:38 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 13 2006, 12:38 PM) View Post[/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:
srollTo(x position, y position)
[/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
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 13 June 2006 - 06:04 PM

Oh crap I'm such a dumb-butt! I was supposed to type scrollTo not srollTo

So yeah the function is:
scrollTo(x position, y position);

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

#6 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 14 June 2006 - 12:09 AM

[!--quoteo(post=383391:date=Jun 13 2006, 07:04 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 13 2006, 07:04 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Oh crap I'm such a dumb-butt! I was supposed to type scrollTo not srollTo

So yeah the function is:
scrollTo(x position, y position);

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.
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users