Open rtonerii opened 5 years ago
I was using the phone format and I found out that any time a user deleted a character it was causing issue.
I modified the function to take care of this.
It does not try to format if they hit the delete key or backspace.
function formatPhone(element) { var key = event.keyCode || event.charCode; if( key == 8 || key == 46 ){ return false; } if (element.value.length == 3) { element.value += "-"; } else if (element.value.length == 7) { element.value += "-"; } }
I was using the phone format and I found out that any time a user deleted a character it was causing issue.
I modified the function to take care of this.
It does not try to format if they hit the delete key or backspace.