Commit 7feb1a67 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Widget.py: Allow to set autocomplete also for hidden fields

We may want to set autocomplete 'off' or whatever other value
parent 4cbc4eea
Pipeline #35704 failed with stage
in 0 seconds
......@@ -170,6 +170,10 @@ class Widget(object):
except KeyError:
# In case extra is not defined as in DateTimeWidget
extra = ''
try:
autocomplete = field.get_value('autocomplete')
except KeyError:
autocomplete = ''
result = ''
# We must adapt the rendering to the type of the value
# in order to get the correct type back
......@@ -179,12 +183,14 @@ class Widget(object):
type="hidden",
name="%s:list" % key,
value=v,
autocomplete=autocomplete,
extra=extra)
else:
result = render_element("input",
type="hidden",
name=key,
value=value,
autocomplete=autocomplete,
extra=extra)
return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment