Reputation: 796
Basically, I have a search box. Once clicked, the value within the search box would be sanitize and then redirects as a Get Var rather than a Post.
I have one method of taking the User's Input value and redirecting to what they want to search (But it turns into a Post Method).
I want to achieve the following:
Rather than:
Upvotes: 1
Views: 540
Reputation: 511
A good idea could be to check how to use window.location Object. You can check this tutorial: How to get url parts in javascript and you can learn:
In addition, you can check document.URL and document.referrer
Upvotes: 1
Reputation:
With:
var value = document.getElementById('id_of_field').value; you get the value of the field and with
window.location = "http://example.com/search/" + value;
Upvotes: 1