Making a specific word entered into a textbox trigger a password prompt that when correctly entered, you are directed to a new page.
Here is what I have so far. I could be way off the mark, but I would like to make it work somehow. This is just for fun, and really does not help in real life, but someone told me I couldn’t do it, so now I’m trying to. Here’s what I have.
<form id="form1">
<input type="text" id="txtInput" size="1" onblur="checkValue()" />
</form>
<script type="text/JavaScript">
function checkValue()
{
var txtCtrl = document.getElementById("txtInput");
var txtValue = txtCtrl.value;
if (txtValue == "test" || txtValue == "vgx" || txtValue == "vgc" || txtValue == "pcv" || txtValue == "pcg")
{
prompt('Enter Password','');
}
if (password != 'pass','password')
{
window.location.href='http://google.com';
}
}
</script>
I’m really sorry I suck so much with JS, kinda new.
Many thanks,
Danny
1 Answer