When clicking on image which is also link to login page with login form, I would like to pass my username. Clicking on image it redirects user to login page and in username field automatically places username which was passed there trough URL so user has to write only password and click button to login.
I was thinking maybe something like this:
<script language="javascript" type="text/javascript">
var scrt_var = {{contact.username}}
</script>
<a href="https://{{contact.image_bank_url}}" onclick="location.href=this.href+'?key='+scrt_var;return false;"><img src="http://image.png"></a>
And this is my username field in login form:
<input id="id_username" name="username" type="text">
Is there maybe other way to do it?