Reputation: 982
code:
I have created an autocomplete suggestion box which is completely fine. Now, I have redirect my selected item from autocomplete to url and my url look like
mywebsite.com/search.php?aa=Admission%20support
here I want to replace %20 with - operator sign after that my url look like
mywebsite.com/search.php?aa=Admission-support
So, How can I do this ?please help me.
<script>
$(function() {
$( "#show" ).autocomplete({
source: 'search-result.php',
minLength:2,
select: function(event, ui)
{
x = ui.item.value;
y = x.replace(/%20/g, "-");
location.href = "search.php?aa="+y;
return false;
}
});
});
</script>
Thank You
Upvotes: 0
Views: 66