0

how to remove "find an item" water mark in the List View ootb search box?

2 Answers 2

1

Using CSS:

<style type="text/css">
.ms-InlineSearch-SearchBox-EmptyUnfocused {
    display:none;
}
.ms-inlineSearch-searchImgSpanStandard {
    float:right;
}
</style>

Using JavaScript:

<script type="text/javascript">
window.onload = function () {

    //Create a function to be able to hide the text if the field loses focus and would need to be hidden again
    function clearSearchbox() {
        //Create a reference to the input search field
        listSearch = document.querySelector('input[id^="inplaceSearchDiv"].ms-InlineSearch-SearchBox-EmptyUnfocused');
        listSearch.value = '';
    };

    //Clear the search input when the page has loaded
    clearSearchbox();

    //Attach en event that to hide the text if the search input loses focus / clicked elsewhere on the page
    listSearch.addEventListener("focusout", clearSearchbox);

};
</script>
0

I think you need to do some custom JavaScript. You can add this JavaScript using Content Editor or using JSLINK.

$("#inplaceSearchDiv_WPQ1_lsinput").value= " "

Above code will make List View OOTB search Box Empty.

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.