Commit 0c188f1d authored by Romain Courteaud's avatar Romain Courteaud

ERP5Form: InputButtonField: src attribute is not allowed for submit type element

parent 0c011964
No related merge requests found
...@@ -71,18 +71,21 @@ class InputButtonWidget(Widget.Widget): ...@@ -71,18 +71,21 @@ class InputButtonWidget(Widget.Widget):
def render(self, field, key, value, REQUEST, render_prefix=None): def render(self, field, key, value, REQUEST, render_prefix=None):
"""Render input button. """Render input button.
""" """
render_kw = {
'name': field.get_value('name'),
'css_class': field.get_value('css_class'),
'value': field.get_value('default'),
'extra': field.get_value('extra')
}
image = field.get_value('image') image = field.get_value('image')
if image: if image:
html_type = "image" html_type = "image"
render_kw['src'] = image
else: else:
html_type = "submit" html_type = "submit"
return Widget.render_element('input', return Widget.render_element('input',
type=html_type, type=html_type,
src=image, **render_kw)
name=field.get_value('name'),
css_class=field.get_value('css_class'),
value=field.get_value('default'),
extra=field.get_value('extra'))
InputButtonWidgetInstance = InputButtonWidget() InputButtonWidgetInstance = InputButtonWidget()
......
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