mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-26 18:37:12 +00:00
autofocus of signup form on first field
This commit is contained in:
parent
25fc35c857
commit
eb6f142bf8
@ -14,6 +14,11 @@ from crispy_forms.layout import Layout
|
||||
|
||||
|
||||
class SignUpForm(UserCreationForm):
|
||||
def __init__(self,*args,**kwargs):
|
||||
super().__init__(*args,**kwargs)
|
||||
self.fields['username'].widget.attrs.pop("autofocus", None)
|
||||
self.fields['first_name'].widget.attrs.update({"autofocus":"autofocus"})
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ['first_name', 'last_name', 'username', 'email']
|
||||
|
@ -10,7 +10,7 @@
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
{{ profile_form|crispy }}
|
||||
<button class="btn btn-link" type="submit">
|
||||
<button class="btn btn-success" type="submit">
|
||||
{% trans "Sign Up" %}
|
||||
</button>
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user