Advance to password field when Enter pressed on username, login page

This commit is contained in:
Lance Edgar 2017-02-13 19:08:18 -06:00
parent 051b52bd4b
commit 6bcfd0515f
2 changed files with 14 additions and 2 deletions

View file

@ -1,6 +1,14 @@
$(function() { $(function() {
$('#username').keydown(function(event) {
if (event.which == 13) {
$('#password').focus().select();
return false;
}
return true;
});
$('form').submit(function() { $('form').submit(function() {
if (! $('#username').val()) { if (! $('#username').val()) {
with ($('#username').get(0)) { with ($('#username').get(0)) {

View file

@ -3,9 +3,13 @@
<%def name="title()">Login</%def> <%def name="title()">Login</%def>
<%def name="head_tags()"> <%def name="extra_javascript()">
${parent.head_tags()} ${parent.extra_javascript()}
${h.javascript_link(request.static_url('tailbone:static/js/login.js'))} ${h.javascript_link(request.static_url('tailbone:static/js/login.js'))}
</%def>
<%def name="extra_styles()">
${parent.extra_styles()}
${h.stylesheet_link(request.static_url('tailbone:static/css/login.css'))} ${h.stylesheet_link(request.static_url('tailbone:static/css/login.css'))}
</%def> </%def>