mbr / flask-bootstrap

Ready-to-use Twitter-bootstrap for use in Flask.
http://pypi.python.org/pypi/Flask-Bootstrap
Other
1.58k stars 724 forks source link

Submit button on quick_form #171

Closed DarkCloud312 closed 6 years ago

DarkCloud312 commented 7 years ago

Hello there.

I have a question with the correct usage of quick_form(form) in specific about the button_map parameter, I don't get what is for from the documentation.

If you used this macro the form is open and close into it. The only way I now to put the submit button into this form is using a wtform.SubmitField(). But in this macro the parameter button_map={} is it to custom a submit button for the form? or what is that parameter for?

Thanks.

DarkCloud312 commented 7 years ago

I mean, I don't really get from documentation or the code what is the button_map={} parameter on quick_form for. If somebody get it, please tell me here, and I will try to summit a change in the documentation to make it more clear if possible.

greyli commented 7 years ago

The button_map use to give the button a different style, instead of default. For example, button_map={'submit': 'success'} will give the button named submit a btn-success style (see Bootstrap documentation for more detail on button styles).

The output will be:

<input type="button" name="submit" class="btn btn-success">