Skip to content

Instantly share code, notes, and snippets.

@evgv
Last active March 2, 2018 09:39
Show Gist options
  • Save evgv/ae5e06265ba72d29062758e30f1a0379 to your computer and use it in GitHub Desktop.
Save evgv/ae5e06265ba72d29062758e30f1a0379 to your computer and use it in GitHub Desktop.
HTML5 Vvalidation patterns

HTML5 validation patterns

Validate telephone (Ukraine)

Pattern

  ^\+38(\s+)?\(?(039|050|063|066|067|068|091|092|093|094|095|096|097|098|099)\)?(\s+)?[0-9]{3}-?[0-9]{4}$

Code

  <input type="tel" name="telephone" id="telephone" class="telephone required" pattern="^\+38(\s+)?\(?(039|050|063|066|067|068|091|092|093|094|095|096|097|098|099)\)?(\s+)?[0-9]{3}-?[0-9]{4}$" title="Telephone, example: +38 (095) 000-0000" required>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment