Add autofocus for some form stuff

This commit is contained in:
swagg boi 2023-10-15 22:30:01 -04:00
parent 0b0d88dc45
commit 682ef0e7c0
9 changed files with 13 additions and 12 deletions

View file

@ -8,7 +8,7 @@
and <%= $error->[3] %> characters.</p>
<% } =%>
<%= label_for email => 'Email' %>
<%= email_field email => (id => 'email') %>
<%= email_field email => (id => 'email', autofocus => undef) %>
</div>
<div class="form-field">
<% if (my $error = validation->error('password')) { =%>

View file

@ -8,7 +8,7 @@
and <%= $error->[3] %> characters.</p>
<% } =%>
<%= label_for name => 'Name' %>
<%= text_field name => (id => 'name') %>
<%= text_field name => (id => 'name', autofocus => undef) %>
</div>
<div class="form-field">
<% if (my $error = validation->error('email')) { =%>

View file

@ -8,7 +8,7 @@
and <%= $error->[3] %> characters.</p>
<% } =%>
<%= label_for email => 'Email' %>
<%= email_field email => (id => 'email') %>
<%= email_field email => (id => 'email', autofocus => undef) %>
</div>
<button type="submit" class="form-button">Demote</button>
</form>

View file

@ -8,7 +8,7 @@
and <%= $error->[3] %> characters.</p>
<% } =%>
<%= label_for email => 'Email' %>
<%= email_field email => (id => 'email') %>
<%= email_field email => (id => 'email', autofocus => undef) %>
</div>
<button type="submit" class="form-button">Lock</button>
</form>

View file

@ -8,7 +8,7 @@
and <%= $error->[3] %> characters.</p>
<% } =%>
<%= label_for email => 'Email' %>
<%= email_field email => (id => 'email') %>
<%= email_field email => (id => 'email', autofocus => undef) %>
</div>
<div class="form-field">
<% if (my $error = validation->error('password')) { =%>

View file

@ -8,7 +8,7 @@
and <%= $error->[3] %> characters.</p>
<% } =%>
<%= label_for password => 'Password' %>
<%= password_field password => (id => 'password') %>
<%= password_field password => (id => 'password', autofocus => undef) %>
</div>
<button type="submit" class="form-button">Reset</button>
</form>

View file

@ -8,7 +8,7 @@
and <%= $error->[3] %> characters.</p>
<% } =%>
<%= label_for email => 'Email' %>
<%= email_field email => (id => 'email') %>
<%= email_field email => (id => 'email', autofocus => undef) %>
</div>
<button type="submit" class="form-button">Promote</button>
</form>

View file

@ -8,7 +8,7 @@
and <%= $error->[3] %> characters.</p>
<% } =%>
<%= label_for email => 'Email' %>
<%= email_field email => (id => 'email') %>
<%= email_field email => (id => 'email', autofocus => undef) %>
</div>
<button type="submit" class="form-button">Unlock</button>
</form>

View file

@ -18,10 +18,11 @@
<% } =%>
<%= label_for answer => "What Roman numeral is this?: $roman_numeral" %>
<%= number_field 'answer', (
id => 'answer',
min => 1,
max => 9,
required => undef
id => 'answer',
min => 1,
max => 9,
required => undef,
autofocus => undef
) %>
</div>
<%= hidden_field number => $roman_numeral, id => 'number' %>