By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,900 Members | 1,342 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,900 IT Pros & Developers. It's quick & easy.

What change on a textarea

P: n/a
I would like to know what change on textarea :
- when user change content with keyboard
- when user drag/drop some text to textarea

By what change, I mean for example, this kind of event :
- at offset 153
- user add this text "azerty"

Is there a way to do it with ECMA ? or perhaps with specific extension
of mozilla or IE ?

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Alexandre Flament wrote on 30 jul 2003 in comp.lang.javascript:
I would like to know what change on textarea :
- when user change content with keyboard
- when user drag/drop some text to textarea

By what change, I mean for example, this kind of event :
- at offset 153
- user add this text "azerty"


with onchange= and this.value you can detect the contents and javascript
code can compare it with the earlier saved [in a variable] contents

....
onchange="compareit(this)"
....

<script>
function compareit(x){
alert(x.value)
if(x.oldvalue)alert(x.oldvalue)
x.oldvalue=x.value
}

to be debugged !

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.