mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-10-31 15:50:03 +01:00 
			
		
		
		
	autofocus of signup form on first field
This commit is contained in:
		| @@ -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> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user