Hello, I want the code to get a button and a text input with html , when click on submit button he will be redirected to a page with url include his entered text like this : www.website.com/"text input" its very simple , but Im beginner so help me
Ok explain me in simple formate. you want one text input with submit button and when some one will enter some text he will redirect some link . e.g http://test.com/TEXT_FROM_BOX? Here is the code!! <script type="text/javascript"> function red(){ var base_url = "http://www.test.com/"; // add your url with trailing slash. var txt = document.getElementById("user_text").value; if(txt == "") { alert('Enter some text'); } else { window.location = base_url + txt; } } </script> <input type="text" size="30" name="user_text" id="user_text" /> <input type="button" onclick="red()" value="Submit / Redirect" />