﻿var empreinteRecherche = 'Nom(s) de produit(s) ou mot(s) clé(s)';
function validateRecherche(val, args)
{
    var txt = trim(args.Value);
    args.IsValid = txt != empreinteRecherche && txt != '';
}
function validateRechercheCP(val, args)
{
    var txt = trim(args.Value);
    var reg = /^[0-9]{5}$/;
    args.IsValid = reg.test( txt) ;
}

function trim(chaine) {
    return chaine.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
