Etudes/BTS/Web/Premiere annee/exempleregexp/js/dateDeNaissance.js

20 lines
548 B
JavaScript
Raw Normal View History

2016-10-14 15:52:18 +00:00
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$(function () {
$("#verifNaissance").click(function (){
dateDeNaissance = $("#dateNaissance").val();
var exp=new RegExp("^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$", "g");
if (exp.test(dateDeNaissance))
{
alert("Syntaxe correct");
}
else
{
alert("Syntaxe incorrect");
}
});
});