Python Flask WT-Forms: Adding JavaScript to Submit a Form without a Submit Button ("AutoPostBack")

Опубликовано: 22 Октябрь 2024
на канале: Thomas Blum
292
6

In this video we look at some example code that uses Python, Flask, and WT-Forms to make a page with a form on which there is no submit input/button. Instead we include some JavaScript that adds an event handler for another element (a number input in this case) and that event handler submits the form. In addition the server (Python-Flask) passed some HTML code (it had some HTML entities), and we used the Jinja safe filter to render that passed HTML.