javascript_tag replacing whitespaces w/ '%20'

I have a form that tests if a title has been changed since the page was loaded and the page has been submitted. If the page title has been changed then a confirm box will ask if the user wants to have the title changed. The problem is if the person hits cancel, all white spaces in the title get replaced w/ '%20'.