Javascript – Validar telefono

Author: Adrià Cidre  |  Category: Java Script, MiniCodes

Función JavaScript para validar el número de telefono.

function isValidPhoneNumber(ph) {
	if (ph == null) {
		return false;
	}
	var stripped = ph.replace(/[\s()+-]|ext\.?/gi, "");
	return ((/\d{10,}/i).test(stripped));
}

Tags: , ,

One Response to “Javascript – Validar telefono”

  1. Gino Correale Says:

    Great article! I bet a lot of work went into this post.

Leave a Reply