This time your demo works good when I check it on my phone. However, when I copy your code and put it to mine, it didn’t work and I don’t know why. Then the one difference I noticed between your example and my project is that you used
<div><input type="text" id="txtNoSpaces" onpaste="return false;" /></div>
But I used
<asp:TextBox ID="txtUsername" runat="server" onpaste="return false;"></asp:TextBox>
Do you think the fact that I am using asp:TextBox is the reason why it is not working? Can you please modify the javascript to make it work for asp:TextBox?
Thanks for the help.