Results 1 to 7 of 7

Thread: [RESOLVED] watch() on an input element's value?

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Resolved [RESOLVED] watch() on an input element's value?

    Okay, I need to know when something is pasted or deleted in a text field by way of the context menu. So I figured I'd use the watch() method on the text field for the value property. But the text field doesn't support the watch method.

    Does anybody know of a way to accomplish what I want?

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: watch() on an input element's value?

    Try onChange. watch() is meant for variables rather than element properties/values.


  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: watch() on an input element's value?

    Unfortunately onChange won't work in my case. onChange only seems to fire when the field loses focus, and I need to know that the change is occuring as it is occuring, not after the fact.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: watch() on an input element's value?

    That's about as far as you can get with javascript. Reminds you of women doesn't it?

    Do you have control over the context menu's javascript? If so, you can populate the textbox and then call your function.

    Alternately, have a timer function which constantly polls the textbox, grabs the value and compares it with the next value.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: watch() on an input element's value?

    Use the keypress event.

  6. #6
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    Re: watch() on an input element's value?

    onkeyup, and onmousedown combined, should cover it.

  7. #7

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: watch() on an input element's value?

    Actually I just found out about the onPropertyChange event which seems to work. Its IE specific I think, but this is for an intranet app, so the client is guarunteed to be IE.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width