Fix usage of label for on login fields
Fix usage of label for on login fields

--- a/js/modules/loginpopup.js
+++ b/js/modules/loginpopup.js
@@ -23,14 +23,14 @@
 
           var usernameDiv = $(document.createElement('div')).addClass('field');
           var usernameLabel = $(document.createElement('label')).attr('for', 'username').text(resources.UsernameLabel);
-          var usernameField = $(document.createElement('input')).attr('type', 'text').attr('name', 'username');
+          var usernameField = $(document.createElement('input')).attr('type', 'text').attr('name', 'username').attr('id', 'username');
           usernameDiv.append(usernameLabel);
           usernameDiv.append(usernameField);
           loginForm.append(usernameDiv);
 
           var passwordDiv = $(document.createElement('div')).addClass('field');
           var passwordLabel = $(document.createElement('label')).attr('for', 'password').text(resources.PasswordLabel);
-          var passwordField = $(document.createElement('input')).attr('type', 'password').attr('name', 'password');
+          var passwordField = $(document.createElement('input')).attr('type', 'password').attr('name', 'password').attr('id', 'password');
           passwordDiv.append(passwordLabel);
           passwordDiv.append(passwordField);
           loginForm.append(passwordDiv);

--- a/templates/login.tpl
+++ b/templates/login.tpl
@@ -22,11 +22,11 @@
   <form method="post" action="{geturl action=login}">
     <div class="field">
       <label for="username">{t}username:{/t}</label>
-      <input type="text" name="username" {if $username}value="{$username}"{/if} autofocus />
+      <input type="text" name="username" id="username" {if $username}value="{$username}"{/if} autofocus />
     </div>
     <div class="field">
       <label for="password">{t}password:{/t}</label>
-      <input type="password" name="password" />
+      <input type="password" name="password" id="password" />
     </div>
     {if $redirect}
     <input type="hidden" name="redirect" value="{$redirect|escape}" />

comments