How to Add Double Quotes automatically in Search Input via JavaScript

Today I will tell the way of How to Add Double Quotes automatically in Search Input via JavaScript. Our one of reader ask that how anyone come to site and search for exact match string via search input field.

You always notice that when a visitor search term with one word long the search results show correct articles. But when a visitor uses a phrase long word or any other, using a minimum of 2 words, the search result are not accurate as the search take long enough as 2 separate search terms.

For accurate search results, CMS Need the visitor to enter “long word” (phrase to be enclosed in double quotes)

This is do automatically, when a user search for 1 word, should leave keyword and pass it without quotes, but when a user uses 2 or more, Search form pass those phrases in Double Quotes.

That’s it Now whenever user search anything the result will come exact same and matched.

How to set auto focus pointer in Input field

You can easily add auto focus in any search field or input field just using simple script of Java.

Hope you like my post just share your experience thru comment.