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: 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
attributebutton
make submit button
… , forget javascript. isn't needed this.
Comments
Post a Comment