See here: http://jsfiddle.net/Txseh/
(function(){
var currentWhitespaceCount;
$("input").keyup(function(e){
var newCount = ($(this).val().match(/\s/g) || []).length;
if (newCount < currentWhitespaceCount)
alert("You removed one or more spaces, fool.");
currentWhitespaceCount = newCount;
});
})();
It tracks the current number of whitespace characters in the input, and if ever the number goes down, it alerts(or does whatever you want).