You are on page 1of 1

How to Format mask Phone number eg:(999) 999-9999 in oracle apex.

Javascript code:

document.getElementById('P1_PHONE_NO').addEventListener('input', function (y) {

var a = y.target.value.replace(/\D/g, '').match(/(\d{0,3})(\d{0,3})(\


d{0,4})/);

y.target.value = !a[2] ? a[1] : '(' + a[1] + ') ' + a[2] + (a[3] ? '-' +
a[3] : '');

});

You might also like