Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

how text for seraching to stay in text box

$
0
0

i used next code for searching 'title' field in document library, but i don't know how text for searching to stay in  text box after click on button search. this code is ok for searching. one more question how get automaticaly url using variable?

<script type="text/javascript">
    function Search() {
        var searchContent = document.getElementById('txtSearch').value;
        if (searchContent != '') {
            var url;
            url = "http://sp/sites/test/Lists/TestFilter/AllItems.aspx?FilterName=Title&FilterMultiValue=*"+searchContent+"*";

            window.location.href = url;
           
        }
        else {
            alert("Something went wrong");
        }
    }</script><input id="txtSearch" type="text"/><input onclick="Search();" type="button" value="Submit"/> 


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>