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.




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


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">
<meta charset="utf-8"/>


<h4>Type in "monkey" to jump to secret monkey.html</h4>

<input type="password" id="filename">
<input type="button" id="btn1" value="Go">

'use strict';
document.getElementById('btn1').onclick = function(){
  window.location.assign(document.getElementById('filename').value.trim() + '.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.

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.

  • Create New...