Reputation: 1353
The textbox shows phone number with format (###)-###-####. while editing, the space & characters needs to be removed to restrict the count to 10 digits. The onkeypress function is not returning the correct value back.
$(document).ready(function () {
$('#<%= TextBox_Phone1.ClientID%>').change(function () {
debugger;
var txtphone = $('#<%= TextBox_Phone1.ClientID%>').val();
$('#<%= TextBox_Phone1.ClientID%>').val = new RegExp(/[&\/\\#,+()$~%.'":*?<>{}]/g, '');
});
});
Upvotes: 0
Views: 171