From 199a9ea52dc8c880418377da41cace4b103df539 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Thu, 11 Aug 2022 14:06:34 +0200 Subject: [PATCH] Aggiunto filtro trim. --- form.go | 3 +++ 1 file changed, 3 insertions(+) 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 { -- 2.49.0