"Intercepting" user input into text box and removing it
- by James P
I have a text box that I would like to do some validation on. At the moment I have this code:
function updateChanger() {
// Validate input
var likeMessage = validateInput($("#like").val());
alert(likeMessage);
}
function validateInput(input) {
input = input.replace(/[^a-zA-Z0-9:\(\/\)\s\.,!~]/g, "");
return input;
}
This…