Delete white spaces in textbox when copy pasted with jquery

I've a textbox of order id(7 digits), which in normal cases you copy paste from email to the textbox, many times you accidently copy one or two white spaces which causing annoying validation error.

I want jquery code in my Layout\MasterPage that does't allow writing white spaces and when copy paste (with keyboard or mouse) numbers with white spaces removes the spaces and keeps the numbers only.

The above should happen only on textboxes with class white-space-is-dead



$('.white-space-is-dead').change(function() {   

Updated copy of your fiddle.

Note that \s may be more than you like. If so, use a literal white space instead

.replace(/ /g,""));

Need Your Help

Allow only triggers to update a column

sql postgresql triggers privileges

I have two tables, t1(foo) and t2(bar), and a trigger on update that updates to something else.

some JavaScript variables missing in scope

javascript scope closures

The problem I am having is that I am trying to access variables that I believe should be in scope but they are not. I am using Underscore.js to loop through arrays and add up values, in the example...