Reputation: 11
Is there any way I can remove a match of a set of first 3 characters in an input field, once a user is done typing, with jQuery?
Upvotes: 0
Views: 230
Reputation: 3106
If you want to remove first three characters after user has moved his cursor to other field, use this code...
$('#yourInputField').blur(function(event) {
field = event.target;
value = field.value;
$('#yourInputField').val(value.substring(3,value.length));
});
Upvotes: 2