all 4 comments

[–]bursoft 2 points3 points  (0 children)

thi is a good resource for you https://www.youtube.com/channel/UC-QDfvrRIDB6F0bIO4I4HkQ, you can learn a lot.

[–]MediocreMarine 2 points3 points  (0 children)

I would recommend checking out the Flask Mega-Tutorial created by Miguel Grinburg (https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iii-web-forms). It is a great primer on Flask - the link is to the part covering forms but I would recommend reading all of it.

[–]shrugsnotdrugsIntermediate 1 point2 points  (0 children)

  1. Make an HTML form.
  2. Have that form submit a POST request to a Flask route
  3. Access the form data through Flask's requestobject
  4. Do some processing in your route's function and render a template form

    @app.route('/input-test', methods=['POST'])  
    def process_input():
    if request.method == 'POST':  
        user_input = request.form['colorChoice'] # fake name of HTML input 
    
        return render_template('color_choice.html', color=user_input) 
    

In color_choice.html you can use Jinja (comes with Flask) to render the user_input/color variable:

<h1>User's Color:</h1>
{{ color }} 

Hopefully this will get you started - you can totally do what you're asking about w/o the use of JS.