goto url based on form

goto url based on form

Hi there, Im new to jquery so bear with me... I have a site setup where i can sort content based on keywords in th url. e.g.

www.examplesite.com/keyword

will only show content related to the keyword.

I want to have a form that takes a text input, apends it to a string and when you press enter redirects you to a url based upon the input.

so putting entering 'foobar' and pressing enter sends you to www.examplesite.com/foobar

heres the code i have so far, it will only send me to www.examplesite.com?keyword_search=keyword even though i know that the variable has the correct content.


html
  1. <form id="search_form"><input type="text" name="keyword_search" value="keyword search"/></form>
javascript
  1.         $(document).ready(function() {
  2.         $('#search_form').submit(function() {
  3.         var goUrl= "http://www.examplesite.com/";
  4.         goUrl = goUrl + $('[name=keyword_search]').val();
  5.         window.location = goUrl;;
  6.         });
  7.         });

best, jon