Last active
December 19, 2015 13:29
-
-
Save mroger/5962666 to your computer and use it in GitHub Desktop.
Exemplo de validação de telefone usando regex em form HTML 5.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>HTML5 Form Validation</title> | |
</head> | |
<body> | |
<form action='teste.asp'> | |
Telefone: | |
<input | |
type="text" | |
name="tel" | |
pattern="^\([1-9][1-9]\)(9[6-9]|[2-5])\d{3}[\.-\s]\d{4}" | |
title="Tel. com nono dígito"> | |
<input type="submit"> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment