-1

Hi I have created the web app, but I am having trouble receiving records from my html table to flask. I use jquery to insert records, but how can I retrieve records from html to flask?

Screenshot is below

Flask Web app

  • Your question is ambiguous. What do you mean when your want to "retrieve records from html to flask"? Flask is a framework which fundamentally answers HTTP-requests. So do you want to send information from your web app to the server? – nehalem Mar 17 '21 at 18:27
  • sorry - i mean retrieve data from htmltable, similar to request.form[inputname] if request.method == "POST": but I add data using the Insert Opening button, I need a function to retrieve all the records back to the server (appended data from html table) – user15238530 Mar 17 '21 at 18:50

1 Answers1

0

You can assign an id to your input field and using jquery make ajax calls where you can retrieve input fields value($("#id").val()) and pass as a query or path parameter.

Jay
  • 29
  • 6
  • Here is my jquery when i do an append $("input[name='']").val(""); Sorry havent use ajax can you please walk me through what you told me? – user15238530 Mar 17 '21 at 19:24
  • Ajax can be used to call an api in background, so using ajax you can make an api call and in your flask app reveive the data the way you passed(request.json() for body parameters, request.args() if query parameter and so on). Check this out - https://www.bogotobogo.com/python/Flask/Python_Flask_with_AJAX_JQuery.php – Jay Mar 17 '21 at 19:31