Issue
So I am making a web app using Flask. And I want the app.py
file to get the id
of an html div from the index.html
file
<td><a href="/edit" id="{{ i+1 }}">Edit</a>    <a href="/delete">✖</a></td>
the {{ i+1 }}
is in jiinja format. I want that to be sent to app.py
when Edit
is clicked
Solution
maybe
href="/edit?{{i+1}}"
- Ouroborus
Good idea.
<td>
<a href="/edit/?id={{i+1}}">Edit</a>
    
<a href="/delete">✖</a>
</td>
and the backend:
@app.route('/edit/')
def edit():
Id = request.args.get("id")
# ...
Answered By - Lima
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.