Skip to content

Commit

Permalink
Adding Autofocus to Frontend Login Form
Browse files Browse the repository at this point in the history
Just like the /administrator login screen, this will make the Username field be autofocus and ready to type in to.
  • Loading branch information
justinherrin committed Jul 31, 2015
1 parent be11290 commit b606b43
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/com_users/views/login/tmpl/default_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
</div>
<?php endif; ?>

<script type="text/javascript">
jQuery(function($) {
$( "#form-login input[name='username']" ).focus();
});
</script>

<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post" class="form-validate form-horizontal well">
<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post" id="form-login" class="form-validate form-horizontal well">

<fieldset>
<?php foreach ($this->form->getFieldset('credentials') as $field) : ?>
Expand Down

0 comments on commit b606b43

Please sign in to comment.