Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can i do this in javascript?

 
yuvaraj KumarAmudhan
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have created a textarea control in html. And whatever i have given in that text area will be updated immediately.

After i typed each word in that text area, immediately the browser should update itself automatically.

can i achieve this using javascript?

thanks if you answer me.

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34179
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think I understand the question. If you type into a text area on a web page, that text shows up in the text area. Where do you want it to show up? Maybe you can show an example?
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4318
234
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is about something like updating the data to the server, then you may need to use some ajax techniques.
 
yuvaraj KumarAmudhan
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i explain you clearly sir!

browser window
---------------------------
-------------------------|
div element |
|
|
|
------------------------ |
| textArea |
| |
| |
---------------------------

I will give some html code in the textarea. That code will be executed in the div element (div.innerHTML = txtArea.value). This should be performed after i type a word.

You may clear now i think.

Thanks!
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Than you need to use onkeypress with the code you already shown.

Eric
 
yuvaraj KumarAmudhan
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you sir!

But from your view,
for each key stroke the onkeypress event will be triggered. But what i want is, after typing a word (not a character) that div should be updated.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you'll need to detect whenever whatever you consider a "word" is complete.

Also, please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

Using a title of "how can i do this in javascript?" in a forum completely dedicated to questions on JavaScript isn't very helpful.

Please go back and change your post to add a more meaningful subject by clicking the
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34179
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yuvaraj yuvan wrote:for each key stroke the onkeypress event will be triggered. But what i want is, after typing a word (not a character) that div should be updated.

You still want the event on each key stroke so you can keep track of the characters in memory until a word is complete. Then add the word to the div and empty the temporary buffer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic