What change on a textarea

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexandre Flament

    What change on a textarea

    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 ?

  • Evertjan.

    #2
    Re: What change on a textarea

    Alexandre Flament wrote on 30 jul 2003 in comp.lang.javas cript:[color=blue]
    > 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"[/color]

    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="compa reit(this)"
    ....

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

    to be debugged !

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    Working...