Default login domain for the ADFS 3.0 change password page

You might have seen that it is possible to customize the ADFS form-based authentication page to programmatically add the domain name when the user provides a sam-account name without the domain. To achieve the same result on the ADFS 3.0 change password page I put together the following JavaScript code that will need to be added to the onload.js that is provided by ADFS:

 var oldVersionOfFunc = UpdatePassword.submitPasswordChange;

UpdatePassword.submitPasswordChange = function() {

  var userName = document.getElementById("userNameInput");

  if (userName.value && !userName.value.match('[@\\\\]'))
    var userNameValue =  'MyNetbiosDomainName\\' + userName.value;
    document.forms['updatePasswordForm'].UserName.value = userNameValue;

  return oldVersionOfFunc.apply(oldVersionOfFunc, args);

Where MyNetbiosDomainName is the NetBIOS domain name for your domain.