Skip to content

Instantly share code, notes, and snippets.

@Vampre
Created October 18, 2012 17:53
Show Gist options
  • Save Vampre/3913747 to your computer and use it in GitHub Desktop.
Save Vampre/3913747 to your computer and use it in GitHub Desktop.
Função mascara CEP colocar em <input type="text" onkeypress='mascaraCEP(this,"id_prox_campo");'>
function mascaraCEP(obj,prox) {
switch (obj.value.length) {
case 6:
obj.value = obj.value + "-";
break;
case 9:
document.getElementById(prox).focus();
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment