2. That function should, in order:
- 'transfer' the value to a hidden input (this is optional, for safety)
- 'clear' the value of the textbox itself
- fire another function which will send, via AJAX technique, data (the hidden input's value) to a server-side application (in order to be submitted, further, to the server's DataBase). That function could be fired from time to time, on using a setTimeout() or a setInterval(). There might be a problem with the order of the AJAX requests, if they are too frequent / time unit, but this is to be solved, somehow, I guess.