Skip to content

Commit

Permalink
Change 'type="text"' to 'type="email" for email inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascumsille committed Apr 30, 2024
1 parent 0629dab commit ede6acc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions templates/web/base/admin/bodies/contact-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,20 @@

<label for="destination">[% loc('Destination') %]</label>
<p class="form-hint" id="destination-hint">
[% SET field_type = 'text' %]
[% IF body.can_be_devolved %]
[% loc('An email address or service ID (Open311 or similar).') %]
[% ELSIF body.send_method == 'Open311' %]
[% loc('A service ID (Open311 or similar).') %]
[% ELSIF body.send_method.match('Email') OR NOT body.send_method %]
[% loc('An email address.') %]
[% SET field_type = 'email' %]
[% ELSE %]
[% loc('An email address or service ID (Open311 or similar).') %]
[% END %]
</p>
<input
[% IF body.can_be_devolved OR body.send_method == 'Open311' %]
type="text"
[% ELSE %]
type="email"
autocomplete="email"
[% END %]
class="form-control" id="destination" aria-describedby="destination-hint" name="email" size="30" value="[% contact.email | html %]" required>
<input type="[% field_type %]" [% IF field_type == 'email' %]
autocomplete="email" [% END %] class="form-control" id="destination" aria-describedby="destination-hint" name="email" size="30" value="[% contact.email | html %]" required>

[% TRY %][% PROCESS 'admin/bodies/_type_field.html' %][% CATCH file %][% END %]

Expand Down
2 changes: 1 addition & 1 deletion templates/web/base/alert/_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h3>[% loc('Subscribe by email') %]</h3>
[% UNLESS c.user_exists AND c.user.email_verified %]
<label for="rznvy">[% loc('Email address') %]</label>
<div class="form-txt-submit-box">
<input class="form-control" type="text" id="rznvy" name="rznvy" value="[% rznvy %]" autocomplete="email">
<input class="form-control" type="email" id="rznvy" name="rznvy" value="[% rznvy %]" autocomplete="email">
<input id="alert_email_button" class="btn-primary" type="submit" name="alert" value="[% loc('Subscribe') %]">
</div>
<p>[% tprintf(loc('We won’t use your email for anything beyond sending you alerts within this area. You can find more information in our <a href="%s">privacy policy</a>.'), c.cobrand.privacy_policy_url) %]</p>
Expand Down

0 comments on commit ede6acc

Please sign in to comment.