Validate malaysian phone number in javascript
My pull request just accepted by chriso author of validator.js, now you can use validator.js to validate malaysian phone number using ‘ms-MY’ locale.
Probably will take sometime before the npm and bower package updated.
You can install via npm,
$npm install --save https://github.com/chriso/validator.js.git
On nodejs,
const v = require('validator')
v.isMobilePhone('+60128747889', 'ms-MY')
On browser,
<script type="text/javascript" src="validator.min.js"></script>
<script type="text/javascript">
validator.isMobilePhone('+60128747889', 'ms-MY') //true
</script>
Btw, i wish the locale is en-MY but there is no such thing. So, i think ms-MY will do.