<!DOCTYPE html> <html> <meta charset= \"UTF-8\"> <head> <script> function valida
ID: 3861845 • Letter: #
Question
<!DOCTYPE html>
<html>
<meta charset= "UTF-8">
<head>
<script>
function validateForm() {
var x = document.forms["myForm"]["email"].value;
var atpos = x.indexOf("@");
var dotpos = x.lastIndexOf(".");
if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length) {
alert("Not a valid e-mail address");
return false;
}
}
</script>
</head>
<body>
<form name="myForm" action="http://weblab.kennesaw.edu/formtest.php" method="post">
Email: <input type="email" name="email" value="ppraneet@students.kennesaw.edu" />
<input type="submit" value="Submit">
</form>
</body>
</html>
output
Error: Start tag head seen but an element of the same type was already open.
From line 5, column 1; to line 5, column 6
"UTF-8"><head><scri
Error: Element head is missing a required instance of child element title.
From line 17, column 1; to line 17, column 7
</script></head><bod
Content model for element head:
If the document is an iframe srcdoc document or if title information is available from a higher-level protocol: Zero or more elements of metadata content, of which no more than one is a title element and no more than one is a base element.
Otherwise: One or more elements of metadata content, of which exactly one is a title element and no more than one is a base element.
please fix the errors and update it
Explanation / Answer
<!DOCTYPE html>
<html>
<head>
<META CHARSET="UTF-8">
<BASE href="http://www.example.com/">
<TITLE>Sample application with a long head</TITLE>
<META NAME="APPLICATION-NAME" CONTENT="Long headed application">
<script>
function validateForm() {
alert('Am Here');
var x = document.forms["myForm"]["email"].value;
var atpos = x.indexOf("@");
var dotpos = x.lastIndexOf(".");
if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length) {
alert("Not a valid e-mail address");
return false;
}
}
</script>
</head>
<body>
<form name="myForm" action="http://weblab.kennesaw.edu/formtest.php" method="post">
Email: <input type="email" name="email" value="ppraneet@students.kennesaw.edu" />
<input type="submit" value="Submit">
</form>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.