[Fixed]-Pass form name variable into url in django

1👍

You should do it through javascript.
Store your url value as a JS variable:

<script> my_url = "{% url 'api:by_book' 'name' %}"; </script>

Change the anchor to a button with a onClick event that calls a function.
In that function you can build the URL with my_url and recovering the name of the input you want with JS.
After that, make a redirection:

window.location = "http://www.yoururl.com";

Leave a comment