1.Paste this into an HTML element.
2. Adjust the tel1 and zip input names to your actual input names.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
var jQ = $.noConflict(true);
jQ(document).ready(function() {
jQ('input[name="tel1"]').keyup(function(){
jQ(this).val(jQ(this).val().replace(/(\d{3})\ ?(\d{3})\ ?(\d{4})/,'$1 $2 $3'))
});
jQ('input[name="zip"]').keyup(function(){
var jQthis = jQ(this);
if(jQthis.val().length < 6){
if (((jQthis.val().length+1) % 4)==0 ){
jQthis.val(jQthis.val() + " ");
}
}
});
});
</script>