Passing Parameters via Button Using JavaScript and Flask

Here’s what I am trying to do. Maybe this will be easier.

So log_results isn’t a url function. All it does is take the results I am passing to the main page and write it to a csv file. It’s only a url because that’s the only working thing I could get via google. If I just call the function when the page loads it works fine. But I have a button on the page that I want to tie to this function. Basically confirming the results and writing to a log.

Anyway…here is what I am trying to do.

I have a first page with some input fields. Data is enter into those fields, and submit button is pressed. Then these items are looked up in a db and passed to a second page will those look up results.

What I want is a button that will call a python function using those results that were passed to the second page.

Like it said that thing I googled (which I won’t lie I don’t know what it’s doing because I have never used JavaScript/jQuery) sort of works if I could just figure out how to pass the parameter to my function.

You can see from the error the function call works, it’s just missing the parameter.

/r/learnpython Thread Parent