diff --git a/templatefunc.go b/templatefunc.go index 5ef9a041..d62442ae 100644 --- a/templatefunc.go +++ b/templatefunc.go @@ -300,7 +300,12 @@ func parseFormToStruct(form url.Values, objT reflect.Type, objV reflect.Value) e formValues := form[tag] var value string if len(formValues) == 0 { - continue + defaultValue := fieldT.Tag.Get("default") + if defaultValue != "" { + value = defaultValue + } else { + continue + } } if len(formValues) == 1 { value = formValues[0]