Skip to content

Commit ac6d24c

Browse files
Add autocomplete attributes to form fields
1 parent 7885017 commit ac6d24c

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

templates/authentication/register.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
<!-- Name Input -->
1111
<div class="mb-3">
1212
<label for="name" class="form-label">Name</label>
13-
<input type="text" class="form-control" id="name" name="name" placeholder="Enter your name" required>
13+
<input type="text" class="form-control" id="name" name="name" placeholder="Enter your name" required
14+
autocomplete="name">
1415
</div>
1516

1617
<!-- Email Input -->
1718
<div class="mb-3">
1819
<label for="email" class="form-label">Email</label>
19-
<input type="email" class="form-control" id="email" name="email" placeholder="Enter your email" required>
20+
<input type="email" class="form-control" id="email" name="email" placeholder="Enter your email" required
21+
autocomplete="email">
2022
</div>
2123

2224
<!-- Password Input -->
@@ -25,7 +27,8 @@
2527
<input type="password" class="form-control" id="password" name="password"
2628
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@$!%*?&\{\}\<\>\.\,\\\\'#\-_=\+\(\)\[\]:;\|~])[A-Za-z\d@$!%*?&\{\}\<\>\.\,\\\\'#\-_=\+\(\)\[\]:;\|~]{8,}"
2729
title="Must contain at least one number, one uppercase and lowercase letter, one special character, and at least 8 or more characters"
28-
placeholder="Enter your password" required>
30+
placeholder="Enter your password" required
31+
autocomplete="new-password">
2932
<div class="invalid-feedback">
3033
Must contain at least one number, one uppercase and lowercase letter, one special character, and at least 8 or more characters
3134
</div>
@@ -35,7 +38,8 @@
3538
<div class="mb-3">
3639
<label for="confirm_password" class="form-label">Confirm Password</label>
3740
<input type="password" class="form-control" id="confirm_password" name="confirm_password"
38-
placeholder="Confirm your password" required>
41+
placeholder="Confirm your password" required
42+
autocomplete="new-password">
3943
<div class="invalid-feedback">
4044
Passwords do not match.
4145
</div>

templates/authentication/reset_password.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="reset-password-form">
99
<form method="POST" action="{{ url_for('reset_password') }}" class="needs-validation" novalidate>
1010
<!-- Hidden Email Input -->
11-
<input type="hidden" name="email" value="{{ email }}">
11+
<input type="hidden" name="email" value="{{ email }}" autocomplete="email">
1212

1313
<!-- Hidden Token Input -->
1414
<input type="hidden" name="token" value="{{ token }}">
@@ -19,7 +19,7 @@
1919
<input type="password" class="form-control" id="new_password" name="new_password"
2020
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@$!%*?&\{\}\<\>\.\,\\\\'#\-_=\+\(\)\[\]:;\|~])[A-Za-z\d@$!%*?&\{\}\<\>\.\,\\\\'#\-_=\+\(\)\[\]:;\|~]{8,}"
2121
title="Must contain at least one number, one uppercase and lowercase letter, one special character, and at least 8 or more characters"
22-
required>
22+
required autocomplete="new-password">
2323
<div class="invalid-feedback">
2424
Must contain at least one number, one uppercase and lowercase letter, one special character, and at least 8 or more characters
2525
</div>
@@ -28,7 +28,8 @@
2828
<!-- Confirm New Password Input -->
2929
<div class="mb-3">
3030
<label for="confirm_new_password" class="form-label">Confirm New Password</label>
31-
<input type="password" class="form-control" id="confirm_new_password" name="confirm_new_password" required>
31+
<input type="password" class="form-control" id="confirm_new_password" name="confirm_new_password"
32+
required autocomplete="new-password">
3233
<div class="invalid-feedback">
3334
Passwords do not match.
3435
</div>

0 commit comments

Comments
 (0)