Inside an html page I have two radio buttons with values A and B. I also have an url to a view that needs two parameters, one is a parameter that I can easily access through the django context variable but the second parameter should have the value A or B based on which radio button is checked. I don't know how to get this done.
I've red this post: Get javascript variable's value in Django url template tag which is kinda what I'm looking for but I don't understand how can this be implemented in my case.
Also checked this post: https://www.reddit.com/r/django/comments/39q9lm/url_tag_in_template_with_a_dynamic_parameter/ which is pretty much the same concept.
What I tried to do in my template is:
<option value="{% url 'view' tmp i %}".replace(/tmp/, 'A');> </option>
which is not exactly what I'm aiming for but it was just to check if this is working.. This is not working to me though. Of course my goal is not to replace tmp with 'A' but with 'A' or 'B' based on which radio button is checked by the user inside my html page. Radio buttons have ids radio1, radio2.
I could use javascript of course but I'd like to stay away from JQuery or Ajax or other stuff in general..
Any help is appreciated Thank you