Jump to content

Recommended Posts

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 by leftreal
Link to post
Share on other sites

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...