I have a textbox, where a forbidden character cant be typed. #.
This works, however, when the textbox is filled in with data, and I put the focus on the middle of th
This is a bit unpleasant, and I'm not 100% happy, but it solves all the given issues that you've had...
$("[id$=txtClient]").keyup(function (e) {
var text = $(this).val();
if (text.indexOf("#") > -1) {
text = text.replace("#", "");
$(this).val(text);
}
});
Here's a jsFiddle example...
http://jsfiddle.net/E4cBK/