case 4:
case 8:
case 11:
if (last_character != '-') {
value = value.substring(0,
current_length - 1);
}
break;
default:
if (!/\d/.test(last_character)) {
value = value.substring(0,
current_length - 1);
}
}
if (current_length > 12) {
value = value.substring(0, current_length
- 1);
}
current_length = value.length;
switch (current_length) {
case 3:
case 7:
case 10:
value += "-";
}
input_object.value = value;
}
}
Form management