function checkAmount(value) { if ( !value.match('^[0-9]+(,[0-9]{1,2}){0,1}$')) { alert("Un montant positif est attendu"); return false; } return true; } function checkQuantity(value) { if ( !value.match('^[0-9]+$') ) { alert("Une quantité positive est attendue"); return false; } return true; } function checkDate(string) { if ( !string.match('^(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/(20[0-9]{2})$') ) { alert("La date est invalide , veuillez entrer une date au format valide(jj/mm/AAAA)"); return false; } return true; } function checkTime(string) { var reg1=new RegExp("^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$", "g"); if (string.match(reg1)) { //alert("L\'heure valide"); return true; } else { alert("L\'heure est invalide, veuillez entrer une heure au format (hh:mm:ss)"); return false; } }