I want to get rid of the code
//strip off html taqs function stripHTML (field) { return field.replace(/<([^>]+)>/g,''); }
within
<script type="text/javascript" src="/Scripts/jquery.min.js"></script> <script type="text/javascript"> jQuery(document).ready(function($){ //attach a function to the keyup event on the filter box $('#filterInput').keyup(function() { DynamicFilter($('#filterInput').val()); }); }) //strip off html taqs function stripHTML (field) { return field.replace(/<([^>]+)>/g,''); } function DynamicFilter(text) { //find out list view (default class for a listview is "ms-listviewtable" $('table [class="ms-listviewtable"]').find('tr').each(function() { //don't filter out the header row if ($(this).attr("class") != "ms-viewheadertr ms-vhltr") { //get the html for the row and strip off the html tabs source = stripHTML($(this).html()); text = text.toLowerCase(); source = source.toLowerCase(); //check to see if the filter text exists in the remaining text if (source.indexOf(text) < 0) { //hide the row if it doesn't contain the text $(this).hide(); } else { //otherwise show it $(this).show(); } } } ); } </script> <div id="mainDiv"> <table> <tbody><tr> <td class="Filter" width="125px">Search: <input type="Text" id="filterInput"/></td> </tr> </tbody></table> </div> ?
when I try to remove the code, the search box breaks, and no longer filters through the list (basically acts as a text box). How do I successfully remove that small bit of code, and keep this alive?
Note: I added this code into a content editor web part. It is currently working, but I can't make any changes to it otherwise it breaks.
- Edited by -TR Wednesday, May 27, 2015 5:13 PM