Skip to content

Instantly share code, notes, and snippets.

@alf
Created April 27, 2011 14:49
Show Gist options
  • Save alf/944383 to your computer and use it in GitHub Desktop.
Save alf/944383 to your computer and use it in GitHub Desktop.
User script to fix enter key during login to Skandiabanken
// ==UserScript==
// @match https://secure.skandiabanken.no/SkbSecure/Authentication/Otp/Default.aspx
// @match https://secure.skandiabanken.no/SkbSecure/Authentication/Otp/SmsOtp.aspx
// ==/UserScript==
var submitOnEnter = function(inputId, linkId) {
var input = document.getElementById(inputId);
var link = document.getElementById(linkId);
if (!input || !link) return;
input.onkeydown = function(e) {
if (e.which == 13) {
document.location = link.href;
return false;
}
return true;
}
}
submitOnEnter('ctl00_MainContentPlaceHolder_boxLogin_txtPassword', 'ctl00_MainContentPlaceHolder_boxLogin_btnLogin');
submitOnEnter('ctl00_MainContentPlaceHolder_boxLogin_txtOpt', 'ctl00_MainContentPlaceHolder_boxLogin_SkbFormButtonForward');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment