so what I try is to show an error "First name must be filled out" as a text called "check", not as an alert... Please help:)
<html>
<body>
<form name="myForm" action="page.html" onsubmit="return validateForm()" method="post">
First name: <input type="text" name="box>
<input type="submit" value="Submit">
</form>
<p id="check"></p>
<script>
function validateForm() {
var x = document.forms["myForm"]["box"].value;
if (x == null || x == "") {
alert("First name must be filled out") ="check"; // I tried to send alert as text...
return false;
}
}
</script>
</body>
</html>
Thanks in advance!