I have a site search (using Examine & Razor) that breaks if a space character is the first or last (or both) character in a search query. For example “hello” & “hello world” both work fine, but ” hello” & “hello ” don’t. Is it possible to remove any spaces such as these before the input field is submitted using JS/JQuery?
Share
I think what you want is JQuery.trim()
http://api.jquery.com/jQuery.trim/