0

In SharePoint 2010, I have inserted Html Form web part to filter my SharePoint list items. When I press GO Button with any of the keywords it will display the items in the list, but when I try to clear the filter or else search with empty keywords it displays No Data in the list.

Please Help me, Actually I want search button with text field to display the items in my SharePoint list. If you have any other web parts can you please help me out to display the search items in web page.

2
  • Can you update your question with the html code that you use in the Html form web part? This might help to find the issue and its possible fix.
    – Ahmad Zia
    Commented Sep 8, 2017 at 5:58
  • Yeah Okay Ahmad Zia, Next time i'll update with the screenshots
    – san
    Commented Sep 15, 2017 at 8:17

1 Answer 1

1
<div onkeydown="T1keydown()">
  <input type="text" name="T1" id="T1T1"/>
  <input type="button" value="Search" onclick="T1apply()"/>

  <script type="text/javascript">

function T1keydown() {
  if (event.keyCode == 13) 
    T1apply();
}

function T1apply() {
  var text = document.getElementById("T1T1").value;
  if (text.length > 0) 
  {
    _SFSUBMIT_;
    return;
  }
  window.location.href=window.location.href;
}

  </script>
</div>

This code will clear all filters.

OR

Go for SharePoint Designer and create parameters and add connection to the web part. When you create parameters then you can connect multiple columns in the list. And it will automatically clear all filters.

2
  • Actually this code was works only when the webpart doesn't have permission to open in SharePoint Designer. Then this code can be used in HTML Form web part's source code it will applies only when the search for empty value then the filter shows no data in List/Library. And also it will works only one single columns to filter.
    – san
    Commented Sep 15, 2017 at 6:14
  • Need to filter Multiple columns then insert HTML Form web part and give connection to one column and go to SPD and create parameter then add connection with Filter values with parameters, by this it will filter multiple columns.
    – san
    Commented Sep 15, 2017 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.