techprogram Posted November 26, 2014 Share Posted November 26, 2014 (edited) Hello Guys i need help in html Example : now we have textbox in html and submit button i want if someone enter some word in textbox then redirected to url Examples : if i enter in textbox this text "java" then redirected to www.java.com if i enter in textbox this text "techprogram" then redirected to some url i put it i hope some one give me the code becouse i really important need it i waiting you guys...! Edited November 26, 2014 by techprogram Link to comment Share on other sites More sharing options...
niche Posted November 26, 2014 Share Posted November 26, 2014 Redirected automatically? Link to comment Share on other sites More sharing options...
techprogram Posted November 26, 2014 Author Share Posted November 26, 2014 hello thanks for comment i think you dont understand what i mean you know vb.net ? like vb.net if textbox1.text = "java" then go www.java.com or any link i put i hope you understand Link to comment Share on other sites More sharing options...
niche Posted November 26, 2014 Share Posted November 26, 2014 This is the html section. There is a vb forum too. Link to comment Share on other sites More sharing options...
davej Posted November 26, 2014 Share Posted November 26, 2014 You said this was an HTML question and then you start talking about vb.net. Are you asking an ASP.NET question? Did you try googling? http://lmgtfy.com/?q=asp.net+redirection Link to comment Share on other sites More sharing options...
techprogram Posted November 27, 2014 Author Share Posted November 27, 2014 (edited) guys what i mean is in html i will give you more examples Example : now we have textbox in html i want if someone type in textbox "english" or any thing i programming it then Redirect him to other page i put what i mean custom url and if someone type in textbox like "spanish" then Redirect him to other page i put and if someone type in textbox like "download game" then Redirect him to game url to download so what i mean if someone type some word in textbox he will Redirect him to custom url and i want to programming the words and the custom URLs but i dont have the code so i hope you guys understand what i mean and help me please i need it so much thanks you please help me with that Edited November 27, 2014 by techprogram Link to comment Share on other sites More sharing options...
davej Posted November 28, 2014 Share Posted November 28, 2014 Simply combine the following examples... http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_url_get http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_loc_href_set Link to comment Share on other sites More sharing options...
Count_Zero Posted November 29, 2014 Share Posted November 29, 2014 (edited) This should do the trick. I have it as a php to use a php include file for the menu, but do away with that and script a menu and you an rename it to html. Just add the java script in the document head and make additional edits to the links it should work for you. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title> Go Ther Example. </title> <link rel="shortcut icon" href="images/favicon.ico" type="images/x-icon" /> <link rel="stylesheet" type="text/css" href="style.css" /> <script language="javascript"> function goThere() { var list = document.forms[0].urlList; location = list.options[list.selectedIndex].value; } </script></head><body> <div id="main_container"> <div id="header"> <div class="head"> <div class="img_head"> <img class="header" src="images/logo.gif" /> </div> </div> </div> <?php include("../menu.php");?> <div id="main_content"> <div id="content"> <h2>Select a location.</h2> <div id="audit_form"> <div class="audit_l"> <form name="f1"> <fieldset class="audit_form"> <legend class="audit_form">Go There:</legend> <select name="s1" onChange="window.location=document.f1.s1.options[document.f1.s1.selectedIndex].value"> <option value=" " selected="selected">-Select-</option> <option value="http://www.somewhere.com/place_one/index.php">Place One</option> <option value="http://www.somewhere.com/place_two/index.php">Place Two</option> <option value="http://www.somewhere.com/place_three/index.php">Place Three</option> <option value="http://www.somewhere.com/place_four/index.php">Place Four</option> <option value="http://www.somewhere.com/place_five/index.php">Place Five</option> </select> </fieldset> </form> </div> </div> </div> </div> </div></body></html> Edited November 29, 2014 by Count_Zero Link to comment Share on other sites More sharing options...
techprogram Posted November 29, 2014 Author Share Posted November 29, 2014 Hello Count_Zero This is not what i mean but its very cool and i think its ok i take the code but i want from you if you tell me how i put image in the dropmanu just inside the place one and 2 and.... Example : [Here Image]Place one in drop manu you understand? Thanks you so much for your help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now