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

Add a wildcard as a querystring to url.

$
0
0

I have a web part for searching for contacts in our directory, which works fine.  You type in the letters, and it web part will autocomplete with lastnames that start with the entered text.  Now, I need to search using a wildcard, so when text is entered, it will match last names or first names.

Below is the javascript function for how the search currently works:

function commitSearch(text) {
var frame = document.getElementById("contactFrame");
if (text == "") frame.src = "Results.aspx?ReturnAll=Yes";
else frame.src = "Results.aspx?Search=" + text;
			}

The last line is the line that needs to be modified.  The wildcard needs to be placed as a querystring, that will search for any text that includes "text" within it, whether it's the last name or the first name.

Any ideas how to add the wildcard in the querystring for the code?

Thanks


Viewing all articles
Browse latest Browse all 25064

Latest Images

Trending Articles



Latest Images

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