locked
Free text entry in the lookup column RRS feed

  • Question

  • Hi,

    I am using a lookup type column in SharePoint list for cascading .user want to add some free text other than the dropdown value.can we provide free text entry in the lookup column.

    Thanks

    Wednesday, July 22, 2020 4:42 PM

All replies

  • Hi Ashish,

    We could use jQuery to achieve this.

    Demo for your reference:

    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script>
    $(function () {
          $("select[title='look']").append("<option >none</option><option >   </option>")
    
       })
    
    </script>

    Test result:

    Tip:The jQuery selector needs to be changed according to your column name.

    This “SharePoint 2013 - Development and Programming” Forum will be migrating to a new home on Microsoft Q&A, please refer to this sticky post for more details.

    Best Regards,

    Amos


    "SharePoint" forums will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "SharePoint" forums' new home on Microsoft Q&A !


    Thursday, July 23, 2020 1:28 AM
  • Hi Amos,

    Thanks for the update. I tried the script shared by you by changing the Title value but its showing blank dropdown where i am not able to insert any value manually. So can you explain little more or can provide the script that will be helpfull.

    Regards,

    Ashish 

    Thursday, July 23, 2020 8:18 AM
  • Hi Ashish,

    The code idea is to find the original select element of the corresponding column. Then add the value we want.You could use developer tool(F12) to check your element attributs.

    You could know about jQuery selector here:

    https://www.w3schools.com/jquery/jquery_ref_selectors.asp

    If you need further help, please share the column name and environment information. Different version of SharePoint may be different

    Best Regards,

    Amos


    "SharePoint" forums will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "SharePoint" forums' new home on Microsoft Q&A !

    Thursday, July 23, 2020 8:28 AM
  • Hi Amos,

    The fileds name is SBU and environment is Sharepoint Online 2019. The snapshot regarding that is mentioned below.

     Thanks



    Thursday, July 23, 2020 8:44 AM
  • Hi,

    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script>
    $(function () {
          $("select[title='SBU']").append("<option >none</option><option >   </option>")
       })
    
    </script>

    It works well in my Online.

    You could check if the code report any error in console window.And is there any other code on this page?

    You could try to debug the code to find reason.

    Debug tutorial:

    https://developers.google.com/web/tools/chrome-devtools/javascript

    jQuery append document:

    https://api.jquery.com/append/

    You could share your full code for further research.

    Best Regards,

    Amos


    "SharePoint" forums will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "SharePoint" forums' new home on Microsoft Q&A !

    Thursday, July 23, 2020 9:04 AM
  • Hi,

    I am checking to see how things are going there on this issue. Please let us know if you would like further assistance.

    You can mark the helpful post as answer to help other community members find the helpful information quickly.

    If you need further help, it would be better to provide details requirement(demo screenshot) so we could try to research.

    Best Regards,

    Amos


    "SharePoint" forums will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "SharePoint" forums' new home on Microsoft Q&A !

    Monday, July 27, 2020 8:04 AM
  • Hi Ashish,

    Sorry for misunderstanding for your requirements.

    Updated code:

    <input type="text" id="test"><input type="button" value="ok" id="ok" >
    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script>
    $("#ok").click(function(){
     $("select[title='SBU']").append("<option >"+$("#test").val()+"</option>")
    })
    
    </script>

    Test result:

    We could add value manually, but it could not be saved in list.

    This forum will be locked down, if you still have issues about this question, you can continue to post in here before 8/10/2020. It is recommended to create a new question on Microsoft Q&A, we will continue to support you on the new home.

    Best Regards.

    Amos


    "SharePoint" forums will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "SharePoint" forums' new home on Microsoft Q&A !



    Tuesday, August 4, 2020 5:58 AM