func CreaMapDb (elems map[string]*FormElement) (map[string]interface{}) {
campi := make(map[string]interface{})
for _, elem := range elems {
- if strings.Contains(elem.Validation, "numeric_it") {
- /* tolgo la formattazione */
- campi[elem.DBName] = strings.ReplaceAll(elem.Value, ".", "")
- campi[elem.DBName] = strings.ReplaceAll(campi[elem.DBName].(string), ",", ".")
- } else {
- campi[elem.DBName] = elem.Value
+ if elem.DBName != "" {
+ if strings.Contains(elem.Validation, "numeric_it") {
+ /* tolgo la formattazione */
+ campi[elem.DBName] = strings.ReplaceAll(elem.Value, ".", "")
+ campi[elem.DBName] = strings.ReplaceAll(campi[elem.DBName].(string), ",", ".")
+ } else {
+ campi[elem.DBName] = elem.Value
+ }
}
}