javascript - create GET request from text box action -


when user enters text or clicks go, need redirect them page value entered request. can't figure out life of me.

i'm using bootstrap , have:

        <div class="input-group">            <input type="text" class="form-control" placeholder="channel name here...">            <span class="input-group-btn">             <button class="btn btn-default" type="button">go!</button>            </span>         </div> 

which produces: enter image description here when user enters text , clicks go, or hits enter want redirect them to

example.com/search/?text=text_entered

  • replace div form.
  • set action of form url (sans query string) want go to.
  • give input name (text in example)
  • remove type attribute button make submit button

… , forget javascript. isn't needed this.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -