leftreal Posted September 23, 2016 Share Posted September 23, 2016 (edited) Hi, I am still a rookie when it comes to HTML and would like to create a form that has a single input field. I would like it to show a password field but whatever you type in it would add the html file extension to it and take you to that page. Example, Say you type monkey then click submit. It would take you to monkey.html which is a webpage within my website. Please help... I keep trying stuff and I am getting more confused the more I try it. Thank you Jesse Edited September 23, 2016 by leftreal Link to comment Share on other sites More sharing options...
leftreal Posted September 23, 2016 Author Share Posted September 23, 2016 Here is the code that I have... <form> <input type="text" name="id"> <input type="submit" text="Password" value="Password"> </form> Link to comment Share on other sites More sharing options...
Ingolme Posted September 23, 2016 Share Posted September 23, 2016 You are either going to have to learn Javascript or learn a server-side scripting language. HTML alone can't do it. 1 Link to comment Share on other sites More sharing options...
leftreal Posted September 24, 2016 Author Share Posted September 24, 2016 Bummer....ok, thank you Link to comment Share on other sites More sharing options...
davej Posted September 24, 2016 Share Posted September 24, 2016 Seems very impractical. Why not use an available HTML/CSS feature such as drop-down menus, styled links or an image map? Here is your idea... <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <title>title</title> </head> <body> <h4>Type in "monkey" to jump to secret monkey.html</h4> Password:<br/> <input type="password" id="filename"> <input type="button" id="btn1" value="Go"> <script> 'use strict'; document.getElementById('btn1').onclick = function(){ window.location.assign(document.getElementById('filename').value.trim() + '.html'); } </script> </body> </html> 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