aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes how can i do this in javascript? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how can i do this in javascript?" Watch "how can i do this in javascript?" New topic
Author

how can i do this in javascript?

yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110

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

Joined: May 26, 2003
Posts: 30780
    
157

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?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3177
    
  47

If it is about something like updating the data to the server, then you may need to use some ajax techniques.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
Than you need to use onkeypress with the code you already shown.

Eric
yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
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

Joined: Jan 10, 2002
Posts: 61437
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30780
    
157

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can i do this in javascript?