I have a problem with my website. When there is "333" in the input box (id textbox_text) website is supposed to redirect to the specified url, but instead nothing happens. Where is the problem?
<script>
function IsEmpty()
{
if(document.forms['frm'].textbox_text.value == "333")
{
window.location.href="martyna-lesniak.html";
}
else
{
alert("Nieprawidłowe hasło!");
}
}
</script>
<div class="container">
<form name="frm">
<input type="password" name="password1" class="password-input" id="textbox_text" placeholder="Wpisz hasło">
<input type="submit" name="submit" onclick="return IsEmpty();" value="Wysyłaj" class="button-input" />
</form>
</div>
You just have to return false;
after your call to window.location.href="martyna-lesniak.html";
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With