I am trying to get the data that I have stored inside of a script tag in my html file to my python file so that I can use it in a python function, does anyone have any idea how I could achieve this? Here's my html code:
<textarea id="rendezook" class="rendezook"></textarea>
<button onclick="get_text();">Valider</button>
<script>
function get_text() {
var x = document.getElementById("rendezook")
location.href = "/validate_comment?rendezook=" + encodeURIComponent(x.value);
console.log(x.value)
}
</script>
And then this is my python file:
@app.route('/validate_comment')
def validate_comment(item_id=None):
print("test")
print(request.args.get("rendezook"))
print("test2")
return redirect(url_for('msr_edit', item_id=72))
test and test2 are not getting printed so it is not entering the function.