Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery validation phone number

function validatePhone(txtPhone) {
    var a = document.getElementById(txtPhone).value;
    var filter = /^((+[1-9]{1,4}[ -]*)|(([0-9]{2,3})[ -]*)|([0-9]{2,4})[ -]*)*?[0-9]{3,4}?[ -]*[0-9]{3,4}?$/;
    if (filter.test(a)) {
        return true;
    }
    else {
        return false;
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to check checked checkbox in jquery 
Javascript :: js date dd.mm.yyyy 
Javascript :: safeareaview react native 
Javascript :: nuxt lang 
Javascript :: js replace all 
Javascript :: how to fetch the all input element id value 
Javascript :: javascript detect backspace 
Javascript :: javascript pdf preview 
Javascript :: react form reload page 
Javascript :: css div at bottom of div 
Javascript :: vue computed composition api 
Javascript :: ReferenceError: Buffer is not defined 
Javascript :: javascript classlist 
Javascript :: check date format javascript 
Javascript :: nodejs request api 
Javascript :: can filter be used on objects in javascript 
Javascript :: sum of digits in a whole number javascript 
Javascript :: startswith 
Javascript :: node redisjson get properties of array object 
Javascript :: javascript class 
Javascript :: file upload with angular material 
Javascript :: install node js 14 
Javascript :: react run on route change 
Javascript :: javascript array group by 
Javascript :: get number from string using jquery 
Javascript :: svelte ondestroy 
Javascript :: vue get element height 
Javascript :: convert array of string to array of objects javascript 
Javascript :: convert array to object javascript 
Javascript :: plotly js y axis range 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =