ted_chou12 Posted April 3, 2007 Share Posted April 3, 2007 Can you have a input box, and when the user hits submit (which is beside the input field), the page redirects, the url contains the input information for example, if I type string, it will redirect me to url like search.php?q=string For certain header reasons, I cant do this in php, so I thought javascript might be able to achieve the same thing. Thanks Ted Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted April 3, 2007 Share Posted April 3, 2007 <input type="text" id="the_field" /> <button type="button" onclick="location.href='http://example.com/page.php?q='+document.getElementById('the_field').value">Go</button> Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted April 3, 2007 Author Share Posted April 3, 2007 thanks, that worked! Ted Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.