none
Search Box and multi select value in Info Path form

    Question

  • Hello,

    Can we implement search box for particular field and select values from that field?

    For example,

    I have "Customers" column, which is fetching values from "Customers" list in the InfoPath form field. Its multiple value selection lookup column. 

    I am editing list form in InfoPath form. so as I have long list for Customers value, can I implement Search on form for "Customers" field and select value/s respectively.

    Please assist.

    Thanking you in advance.

    Regards,

    Jayashri

    Tuesday, March 07, 2017 9:09 AM

All replies

  • Hi Jayashri- if I understand you correctly, the following link provides a solution based on filtering the query using a user entered value:

    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/dcf98a77-6770-456a-956d-b6c6a95abe78/how-to-filter-the-multiple-list-selection-box-in-info-path-form?forum=sharepointcustomizationlegacy


    cameron rautmann

    Tuesday, March 07, 2017 4:12 PM
  • Thanks for the updates.

    But this is not the thing I am looking for.

    Search like in below link, explained for default form of list:

    https://social.msdn.microsoft.com/Forums/office/en-US/292ddd49-1850-4d55-8b75-a440b227a3a8/search-in-list-column?forum=sharepointgeneral

    Thanking you in advance.

    Regards,

    Jayashri

    Wednesday, March 08, 2017 1:15 AM
  • Hi Jayashri,

    Please check the code below:

    <script src="//code.jquery.com/jquery-3.1.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    var lookupOptions;
    $(function(){
    	lookupOptions=$("select[title='Customers possible values']").clone();
    	$("h3.ms-standardheader:contains('Customers')").closest("td").next().prepend("<input id='searchLookupField' type='text' placeholder='Search Customers'/>");
    	
    	$("#searchLookupField").keyup(function(){
    		var keyword=$(this).val();
    		var html="";
    		lookupOptions.find("option").each(function(){
    			if($(this).text().toLowerCase().indexOf(keyword)>=0){
    				html+=$(this).prop("outerHTML");
    			}
    		});
    		$("select[title='Customers possible values']").html(html);
    	});	
    });
    </script>

    Add the code into a content editor web part into the list form page.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, March 08, 2017 7:04 AM
    Moderator