Add the following script to change input type text to phone no format.
jQuery('#phone-field').on('keyup', function(e){
let val = e.target.value;
e.target.value = val
.replace(/\D/g, '')
.replace(/(\d{1,3})(\d{1,3})?(\d{1,4})?/g, function(txt, f, s, t) {
if (t) {
return `(${f}) ${s}-${t}`
} else if (s) {
return `(${f}) ${s}`
} else if (f) {
return `(${f})`
}
});
});
let val = e.target.value;
e.target.value = val
.replace(/\D/g, '')
.replace(/(\d{1,3})(\d{1,3})?(\d{1,4})?/g, function(txt, f, s, t) {
if (t) {
return `(${f}) ${s}-${t}`
} else if (s) {
return `(${f}) ${s}`
} else if (f) {
return `(${f})`
}
});
});