diff --git a/docker/routlin-dash/app/factory.py b/docker/routlin-dash/app/factory.py index bc4435c..36105b5 100644 --- a/docker/routlin-dash/app/factory.py +++ b/docker/routlin-dash/app/factory.py @@ -462,7 +462,7 @@ def collect_form_originals(items, tokens): if t == 'field': name = item.get('name', '') input_type = item.get('input_type', 'text') - if not name or input_type == 'hidden': + if not name or input_type in ('hidden', 'password'): continue value = apply_tokens(item.get('value', ''), tokens) if input_type == 'checkbox': @@ -1346,9 +1346,10 @@ def build_item(item, tokens, inherited_req=None): inner = build_items(item.get('items', []), tokens, req) hash_field = f'' originals = collect_form_originals(item.get('items', []), tokens) + has_data = any(v not in ('', []) for v in originals.values()) orig_field = ( f'' - if originals else '' + if has_data else '' ) field_specs, submit_sel = collect_form_specs(item.get('items', [])) script = build_form_script(field_specs, submit_sel) if (field_specs and submit_sel) else ''