From: Andrea Zagli Date: Thu, 11 Aug 2022 12:06:34 +0000 (+0200) Subject: Aggiunto filtro trim. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=199a9ea52dc8c880418377da41cace4b103df539;p=zakegg_go Aggiunto filtro trim. --- diff --git a/form.go b/form.go index cbffd01..4b91506 100644 --- a/form.go +++ b/form.go @@ -181,6 +181,9 @@ func CreaMapValidator(elems map[string]*FormElement, r *http.Request) (map[strin case "uppercase": elem.Value = strings.ToUpper(r.FormValue(elem.Name)) valori[elem.Name] = elem.Value + case "trim": + elem.Value = strings.Trim(r.FormValue(elem.Name), " ") + valori[elem.Name] = elem.Value } } } else {