I have a form where a check an input field for its value and then i do an Ajax call using the typewatch plugin ( a small little thing which detects that the user has stopped typing after a predefined interval ). It works great.
As this field is a "coupon discount" in an order form, the value could be entered by copy pasting the "coupon code" from an email or something. It also works with Ctrl+C - Ctrl+V for Copy and paste but not when a user selects the text with the mouse, clicks copy from the context menu and then paste from this menu.
Is there a way in jQuery to check for this kind of behaviour in jQuery somehow?
You could set a low time out (1 second) that checks is the value has changed since the last check.
You could also simply ignore it and when the form submits grab the contents of this coupon discount input and process it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With