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 Link to comment https://forums.phpfreaks.com/topic/45436-text-value-submit-redirect/ 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> Link to comment https://forums.phpfreaks.com/topic/45436-text-value-submit-redirect/#findComment-220635 Share on other sites More sharing options...
ted_chou12 Posted April 3, 2007 Author Share Posted April 3, 2007 thanks, that worked! Ted Link to comment https://forums.phpfreaks.com/topic/45436-text-value-submit-redirect/#findComment-220639 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.