-
Notifications
You must be signed in to change notification settings - Fork 3
/
fonctions.js
38 lines (33 loc) · 1.2 KB
/
fonctions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
+-------------------------------------------------------------------------+
| Monnaie M - http://merome.net/monnaiem |
+-------------------------------------------------------------------------+
| Auteur : Jérôme VUITTENEZ - Merome : [email protected] |
+-------------------------------------------------------------------------+
*/
function FormatDate(champ_date) {
var value_date = champ_date.value;
if ( (value_date.length == 2) && (value_date.indexOf("/") == -1) ) {
value_date = value_date + "/";
champ_date.value = value_date;
}
if ( (value_date.length == 5) && (value_date.lastIndexOf("/") == 2) ) {
value_date = value_date + "/";
champ_date.value = value_date;
}
// Empêche la double saisie d'un "/"
p = "\/\/";
if (value_date.match(p)) {
value_date = value_date.replace(p, "/");
champ_date.value = value_date;
}
}
function verifInt(champ)
{
reg = new RegExp('[^0-9]+', 'g');
valeur = champ.value;
if(reg.test(valeur))
champ.value=champ.value.replace(/[^0-9]+/, '');
else
return true;
}