Skip to content

Commit

Permalink
improved examples with autocapitalization (#189)
Browse files Browse the repository at this point in the history
* improved examples with autocapitalization

* example for month added
  • Loading branch information
PanderMusubi committed Jun 29, 2022
1 parent 525eb77 commit 8aaffd8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions examples/bootstrap4/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,21 @@ class ExampleForm(FlaskForm):
datetime = DateTimeField(render_kw={'placeholder': 'this is a placeholder'}) # add HTML attribute with `render_kw`
datetime_local = DateTimeLocalField()
time = TimeField()
month = MonthField()
floating = FloatField()
integer = IntegerField()
decimal_slider = DecimalRangeField()
integer_slider = IntegerRangeField(render_kw={'min': '0', 'max': '4'})
email = EmailField()
url = URLField()
search = SearchField()
telephone = TelField()
image = FileField(render_kw={'class': 'my-class'}, validators=[Regexp('.+\.jpg$')]) # add your class
option = RadioField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
select = SelectField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
select_multiple = SelectMultipleField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
bio = TextAreaField()
title = StringField()
search = SearchField() # will autocapitalize on mobile
title = StringField() # will not autocapitalize on mobile
secret = PasswordField()
remember = BooleanField('Remember me')
submit = SubmitField()
Expand Down
5 changes: 3 additions & 2 deletions examples/bootstrap4/templates/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ <h2>Example Form</h2>
datetime = DateTimeField(render_kw={'placeholder': 'this is a placeholder'}) # add HTML attribute with `render_kw`
datetimelocal = DateTimeLocalField()
time = TimeField()
month = MonthField()
floating = FloatField()
integer = IntegerField()
decimalslider = DecimalRangeField()
integerslider = IntegerRangeField(render_kw={'min': '0', 'max': '4'})
email = EmailField()
url = URLField()
search = SearchField()
telephone = TelField()
image = FileField(render_kw={'class': 'my-class'}, validators=[Regexp('.+\.jpg$')]) # add your class
option = RadioField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
select = SelectField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
selectmulti = SelectMultipleField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
bio = TextAreaField()
title = StringField()
search = SearchField() # will autocapitalize on mobile
title = StringField() # will not autocapitalize on mobile
secret = PasswordField()
remember = BooleanField('Remember me')
submit = SubmitField()</pre>
Expand Down
5 changes: 3 additions & 2 deletions examples/bootstrap5/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,21 @@ class ExampleForm(FlaskForm):
datetime = DateTimeField(render_kw={'placeholder': 'this is a placeholder'}) # add HTML attribute with `render_kw`
datetime_local = DateTimeLocalField()
time = TimeField()
month = MonthField()
floating = FloatField()
integer = IntegerField()
decimal_slider = DecimalRangeField()
integer_slider = IntegerRangeField(render_kw={'min': '0', 'max': '4'})
email = EmailField()
url = URLField()
search = SearchField()
telephone = TelField()
image = FileField(render_kw={'class': 'my-class'}, validators=[Regexp('.+\.jpg$')]) # add your class
option = RadioField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
select = SelectField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
select_multiple = SelectMultipleField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
bio = TextAreaField()
title = StringField()
search = SearchField() # will autocapitalize on mobile
title = StringField() # will not autocapitalize on mobile
secret = PasswordField()
remember = BooleanField('Remember me')
submit = SubmitField()
Expand Down
5 changes: 3 additions & 2 deletions examples/bootstrap5/templates/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ <h2>Example Form</h2>
datetime = DateTimeField(render_kw={'placeholder': 'this is a placeholder'}) # add HTML attribute with `render_kw`
datetimelocal = DateTimeLocalField()
time = TimeField()
month = MonthField()
floating = FloatField()
integer = IntegerField()
decimalslider = DecimalRangeField()
integerslider = IntegerRangeField(render_kw={'min': '0', 'max': '4'})
email = EmailField()
url = URLField()
search = SearchField()
telephone = TelField()
image = FileField(render_kw={'class': 'my-class'}, validators=[Regexp('.+\.jpg$')]) # add your class
option = RadioField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
select = SelectField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
selectmulti = SelectMultipleField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')])
bio = TextAreaField()
title = StringField()
search = SearchField() # will autocapitalize on mobile
title = StringField() # will not autocapitalize on mobile
secret = PasswordField()
remember = BooleanField('Remember me')
submit = SubmitField()</pre>
Expand Down

0 comments on commit 8aaffd8

Please sign in to comment.