• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how can i do this in javascript?

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic