From 32a98cfdd5dcfde6dae8d2040d7150b173b2e8ac Mon Sep 17 00:00:00 2001 From: Cory Veilleux Date: Tue, 26 Mar 2019 12:21:32 -0400 Subject: [PATCH 1/3] Adding id and name to form fields. Currently form fields are missing id and name. On the previous line you can see the label is using the node.id, so using this in the input to match. --- flask_bootstrap/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_bootstrap/forms.py b/flask_bootstrap/forms.py index 3a457c05..c1a34bf0 100644 --- a/flask_bootstrap/forms.py +++ b/flask_bootstrap/forms.py @@ -48,7 +48,7 @@ def _wrapped_input(self, node, classes=['form-control'], **kwargs): wrap = self._get_wrap(node) wrap.add(tags.label(node.label.text, _for=node.id)) - wrap.add(tags.input(type=type, _class=' '.join(classes), **kwargs)) + wrap.add(tags.input(id=node.id, name=node.id, type=type, _class=' '.join(classes), **kwargs)) return wrap From 63af49f7f756bce7f3031186f044da564323491e Mon Sep 17 00:00:00 2001 From: Cory Veilleux Date: Tue, 26 Mar 2019 12:34:44 -0400 Subject: [PATCH 2/3] Setting value on the input. Similar to id and name, value wasn't present on the inputs. On pages where submits send the user back to the form, this would mean that all values would be cleared out after form submission rather than being preserved in the form. --- flask_bootstrap/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_bootstrap/forms.py b/flask_bootstrap/forms.py index c1a34bf0..09e1e028 100644 --- a/flask_bootstrap/forms.py +++ b/flask_bootstrap/forms.py @@ -48,7 +48,7 @@ def _wrapped_input(self, node, classes=['form-control'], **kwargs): wrap = self._get_wrap(node) wrap.add(tags.label(node.label.text, _for=node.id)) - wrap.add(tags.input(id=node.id, name=node.id, type=type, _class=' '.join(classes), **kwargs)) + wrap.add(tags.input(id=node.id, name=node.id, value=node.data, type=type, _class=' '.join(classes), **kwargs)) return wrap From 57eb7163bbee52ee30091439d75e0deea540e39b Mon Sep 17 00:00:00 2001 From: Cory Veilleux Date: Tue, 26 Mar 2019 12:55:55 -0400 Subject: [PATCH 3/3] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c5ff768e..3e599b25 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ def read(fname): setup( name='Flask-Bootstrap', - version='3.3.7.2.dev1', + version='3.3.7.2', url='http://github.com/mbr/flask-bootstrap', license='BSD', author='Marc Brinkmann',