Skip to content
Snippets Groups Projects
Commit 506331f4 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Disable login button with JS after first click.

Impatient users will press the button twice which leads (esp in Chrome it seems) to NOSTATE errors.
parent e24c2fa1
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,9 @@
"login_button": {
"en": "Login"
},
"processing": {
"en": "Processing..."
},
"username": {
"en": "Username"
},
......
......@@ -67,7 +67,7 @@ if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled'])
} else {
$text = $this->t('{login:login_button}');
echo str_repeat("\t", 4);
echo "<input type=\"submit\" tabindex=\"4\" id=\"regularsubmit\" value=\"{$text}\" />";
echo "<input onclick=\"this.value='" . $this->t('{login:processing}') . "';this.disabled=true;this.form.submit();return true;\" type=\"submit\" tabindex=\"4\" id=\"regularsubmit\" value=\"{$text}\" />";
}
?>
</td>
......@@ -81,7 +81,7 @@ if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled'])
$rowspan = (array_key_exists('organizations', $this->data) ? 2 : 1);
?>
<td style="padding: .4em;" rowspan="<?php echo $rowspan; ?>">
<input type="submit" tabindex="5" id="regularsubmit" value="<?php echo $this->t('{login:login_button}'); ?>" />
<input onclick="this.value='<?php echo $this->t('{login:processing}'); ?>';this.disabled=true;this.form.submit();return true;" type="submit" tabindex="5" id="regularsubmit" value="<?php echo $this->t('{login:login_button}'); ?>" />
</td>
<?php
}
......@@ -121,7 +121,7 @@ foreach ($this->data['organizations'] as $orgId => $orgDesc) {
}
?>
<tr><td></td><td>
<input type="submit" tabindex="5" id="mobilesubmit" value="<?php echo $this->t('{login:login_button}'); ?>" />
<input onclick="this.value='<?php echo $this->t('{login:processing}'); ?>';this.disabled=true;this.form.submit();return true;" type="submit" tabindex="5" id="mobilesubmit" value="<?php echo $this->t('{login:login_button}'); ?>" />
</td></tr>
</table>
<?php
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment