Is it possible to automatically submit a form when the user exits the page?
Here's the code snippet:
<form class="carform" method="get">
<input type="hidden" name="number_plate" value="{{ car.number_plate }}">
</form>
I want the form to be submitted automatically when the user leaves the page, either by clicking a back button or entering a new URL. This way, the value inside the form can be sent and accessed by other views using the get method.
UPDATE: The goal is for the form to be submitted when the user changes the URL or navigates back using the browser button.