Thursday, June 21, 2012

SharePoint 2010 FBA : Renaming the dropdown box values in login page


<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">

<script language="javascript" type="text/javascript">

  function changeDropdownValues()
    {
        var ddlLogin = document.getElementById("<%=ClaimsLogonSelector.ClientID %>");
        ddlLogin.options[1].innerText = "Internal Employees";
        ddlLogin.options[2].innerText = "External Partners";
    }

    _spBodyOnLoadFunctionNames.push("changeDropdownValues");

</script>

</ asp:Content>


9 comments:

  1. update below line....

    if(document.getElementsByTagName("ddlLogin").length=0 or null)

    ReplyDelete
    Replies
    1. What should be done with this Java script code ?
      I am trying to change the Drop Down values...Could find NOTHING on the internet...THey are just values (Forms Authentication & Windows Authentication)...I need FBA to show Partner Authentication...is this script usefull?

      Delete
  2. Hi,

    How we can implement this code, if could you share the steps with us, it will be great.

    Thanks & Regards
    Amit Kharbanda

    ReplyDelete
    Replies
    1. Amit,

      follow this post
      http://suryapulipati.blogspot.com/2012/06/sharepoint-2010-with-uag-sso.html

      THanks,
      Surya.

      Delete
  3. Hi Surya,

    My requirement is just to rename the Windows Authentication and Farm Authentication with Internal and External.
    As per your code, I need go on below location
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\IDENTITYMODEL\LOGIN and add the below code

    asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"
    script language="javascript" type="text/javascript"

    function changeDropdownValues()
    {
    var ddlLogin = document.getElementById("<%=ClaimsLogonSelector.ClientID %>");
    ddlLogin.options[1].innerText = "Internal Employees";
    ddlLogin.options[2].innerText = "External Partners";
    }

    _spBodyOnLoadFunctionNames.push("changeDropdownValues");

    script

    asp:Content

    Is it correct or I need to do something else to make this happen?

    Thanks for quick response and support in advance

    Regards

    ReplyDelete
  4. Thank you so much Surya, its working now

    Regards
    Amit Kharbanda

    ReplyDelete

Followers