Nepali Phone Number Validator Javascript [JS+PHP]

Many nepali online sites have form to insert phone number in them.In this example i am going to show how to validate Nepali Phone Number [Ncell,NTC,Sky,Smart] Mobile phone number using Js Regex

/* elem means input object whose email data is to be validated */
function phoneValidator(elem)
{	var phoneExp = /^9+([7-8][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]+)/;	if(elem.val().match(phoneExp) && elem.val().length==10)	{	return true;	}	else	{	return false;	}

Place this in your Js Submission page for Clent side Validation and PHP Validation via

function check_mail_addr($input_email=""){ if(preg_match("//^9+([7-8][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]+)//", $input_email)) { return true; }


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.