0% found this document useful (0 votes)
147 views

How To Format Mask Phone Number

This document provides a JavaScript code to format phone numbers entered in an Oracle Apex application. The code listens for input events on the phone number field, removes non-numeric characters, and dynamically formats the number as (###) ###-####.

Uploaded by

Mahmoud Hadiya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
147 views

How To Format Mask Phone Number

This document provides a JavaScript code to format phone numbers entered in an Oracle Apex application. The code listens for input events on the phone number field, removes non-numeric characters, and dynamically formats the number as (###) ###-####.

Uploaded by

Mahmoud Hadiya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 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