I have the code:
$("#txtDescription").blur(function(){
$("#txtDescription").text($("#txtDescription").text().replace('@', ''));
})
which removes the @ symbol is someone copies it into a text area. The problem with this is that in IE (all versions) it also removes any line breaks which were added and adds all text on a single line with spaces. The other problem is that if I save the information to a DB table the line breaks are actually there so it only seems to be a visual thing. Not good if a user thinks their information is all on a single line.
Does anyone have any suggestions how to remove characters if a user pastes into a textarea?
1 Answer