Edit: Nevermind found the answer. Simply needed to add "show=show.replace(' ','-');" Hi i'm working on a simple TV site. I'm using the below script which works perfectly to take the user to a page on the site based on whatever they type. However when somebody types in "the sopranos" they will be taken to mysite.com/the sopranos.php rather than mysite.com/the-sopranos.php. What can I add to replace the blank space with a dash? Also I'm aware I can force the user to not type spaces so they submit thesopranos and it becomes mysite.com/thesopranos.php but I'd much prefer the first solution. Thanks in advance for any help!
I would suggest you to either use escape or encodeURI instead. http://xkr.us/articles/javascript/encode-compare/