Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

Add domain to paginatedOnload.js #63

Open

Description

Hi,

How can i add the domain to the userfield like we did before in our 2012 adfs onload.js like this:

if (typeof Login != 'undefined'){
    Login.submitLoginRequest = function () { 
    var u = new InputUtil();
    var e = new LoginErrors();
    var userName = document.getElementById(Login.userNameInput);
    var password = document.getElementById(Login.passwordInput);
    if (userName.value && !userName.value.match('[@\\\\]')) 
    {
        **var userNameValue = 'contoso.com\\' + userName.value;**
        document.forms['loginForm'].UserName.value = userNameValue;
    }

    if (!userName.value) {
       u.setError(userName, e.userNameFormatError);
       return false;
    }

Where should i add this in the code for paginatedonload.js

var usernameInput = document.getElementById("userNameInput");
var passwordInput = document.getElementById('passwordInput');

if ( usernameInput && passwordInput)
{
    var username = document.getElementById('userNameArea');
    var passArea = document.getElementById('passwordArea');
    
    var submitButton = document.getElementById('submitButton');
    var submissionArea = document.getElementById('submissionArea');
    var errorText = document.getElementById('errorText');
    var errorDisplay = document.getElementById('error');
    var workArea = document.getElementById('workArea');
    
    var loginMessage = document.getElementById('loginMessage');
    var originalLoginMessage = "";
    var didLoadPasswordPageBefore = false;

Activity

  1. tjc-jhol commented on Jan 6, 2021

    @tjc-jhol

    I would like to know this as well.

    My guess would be:

    var usernameInput = document.getElementById("userNameInput");
    var passwordInput = document.getElementById('passwordInput');
    
    if ( usernameInput && passwordInput)
    {
        var username = document.getElementById('userNameArea');
        var passArea = document.getElementById('passwordArea');
        
        // Allows the user to not have to specify the domain in the username field.
        if (username.value && !username.value.match('[@\\\\]')) 
        {
            var usernameValue = 'contoso.com\\' + username.value;
            document.forms['loginForm'].username.value = usernameValue;
        }
    
        var submitButton = document.getElementById('submitButton');
        var submissionArea = document.getElementById('submissionArea');
        var errorText = document.getElementById('errorText');
        var errorDisplay = document.getElementById('error');
        var workArea = document.getElementById('workArea');
        
        var loginMessage = document.getElementById('loginMessage');
        var originalLoginMessage = "";
        var didLoadPasswordPageBefore = false;
  2. tjc-jhol commented on Jan 6, 2021

    @tjc-jhol

    Or actually, I think you just add it somewhere in the file relooking at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions