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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -21,7 +21,8 @@
id => 'answer', id => 'answer',
min => 1, min => 1,
max => 9, max => 9,
required => undef required => undef,
autofocus => undef
) %> ) %>
</div> </div>
<%= hidden_field number => $roman_numeral, id => 'number' %> <%= hidden_field number => $roman_numeral, id => 'number' %>