1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| onSoumet.prototype.lesReg = function(champ, valeur){
this.ReReg['Cheque'] = /^[,0-9]+$/;
this.ReReg['Titre'] = /^[^-][[:alpha:]-][^-]+$/;
this.ReReg['Nom'] = /^[^-][[:alpha:]-][^-]+$/;
this.ReReg['pre'] = /^[^-][[:alpha:]-][^-]+$/;
this.ReREg['ad1'] = /^[^<>*]+$/;
this.ReREg['ad2'] = /^[^<>*]+$/;
this.ReREg['cp'] = /^[ 0-9\.]+$/;
this.ReReg['Tel1'] = /^[ 0-9\.]+$/;
this.ReReg['Tel2'] = /^[ 0-9\.]+$/;
this.ReReg['Tel3'] = /^[ 0-9\.]+$/;
this.ReReg['Port1'] = /^[ 0-9\.]+$/;
this.ReReg['Fax'] = /^[ 0-9\.]+$/;
this.ReReg['email1'] = /^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$/;
this.ReReg['email2'] = /^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$/;
return (this.ReReg[champ].test(valeur))
}; |