/flask-dynamic-ajax-wtforms

Flask App demonstrating a way on how to dynamically generate and process form fields using WTForms submitted via Ajax requests

Primary LanguageHTML

Dynamic Ajax WTForm Example

Example Flask App demonstrating a way on how to dynamically generate and process form fields using WTForms that are eventually submitted via Ajax requests. Fields can be generated both from server- and client-side.

Processes/generates simple FormFields and WTForms Field Enclosures (both MultiFields [a list of fields] and MultiField Enclosures [a list of forms]).

Install

  • install packages e.g., using a venv and pip from requirements.txt
  • run app.py

Credits

Python

Stackoverflow

  • WTForms Validation Flow using both client/server side validation

JS

BootSnipp snippet

  • to implement add/remove buttons for form fields