I have the below code:
<form name="myForm" action="C:\dev\page2.html" onsubmit="return validateForm()" method="post">
ABCD 1234: <input type="text" name="fname">
<input type="submit" value="Submit">
</form>
<script>
function validateForm() {
var x = document.forms["myForm"]["fname"].value;
if (x == null || x == "") {
alert("You haven't completed this task yet!");
return false;
}
}
</script>
In the input, the user needs to type ABCD 1234 as per the name of the form field, If the user inputs no information they get a pop up saying they haven't completed the task yet, however I need it so if the user inputs the ABCD 1234 they'll be granted access to the next page, and if they put in anything different it will return that pop up.
Can anyone help me please?