From 2e8a8a62f9b8152747b75ea12751f9bb012ee418 Mon Sep 17 00:00:00 2001 From: Tim Nyborg Date: Mon, 17 Jun 2019 12:13:15 +0100 Subject: [PATCH] fix error block location in radio buttons Currently, radio widget error messages appear between the final checkbox and the final label. Instead, use CheckboxesWidget's invisible input method to display errors on radio widgets. --- gluon/sqlhtml.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 438e4333..30d299c2 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -461,7 +461,12 @@ class RadioWidget(OptionsWidget): opts.append(child(tds)) if opts: - opts[-1][0][0]['hideerror'] = False + opts.append( + INPUT(requires=attr.get('requires', None), + _style="display:none;", + _disabled="disabled", + _name=field.name, + hideerror=False)) return parent(*opts, **attr)