javascript - Should I use change or input event to save data? -


i'm still learning best way things through jquery , javascript. i've got several input text boxes want instantaneously update record when change made.

handling similar event winforms perspective in past, have handled in handler text change or got / lost focus event. understand "input" , "change" rough equivalents of these input elements.

i want ensure 100% of time change made when text changed. concern using "input" event possible overhead involved, while concern "change" event out of event's scope handle (such browser closing, session expiration, etc.) occur , prevent update.

i'd prefer use "input", thought of having database hit every time types or deletes character worries me. "change" ok if had way prevent scenario mentioned above.

the bottom-line this: "input" if overhead isn't concern; "change" if there way (which i'm not aware of) ensure gets saved, possibly handling event well.

what should do? thanks!


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -