updated folder structure
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
<html>
|
||||
<body>
|
||||
<div id="wrapper"></div>
|
||||
<form action="anotherpage.html" method="get" onsubmit="return valForm()">
|
||||
<input type="text" id="firstName" name="firstName" placeholder="First name" />
|
||||
<input type="text" id="lastName" name="lastName" placeholder="Last name" />
|
||||
<input type="text" id="age" name="age" placeholder="Age" />
|
||||
<input type="submit" value="submit" />
|
||||
</form>
|
||||
<script>
|
||||
function valForm() {
|
||||
var p = event.target.children;
|
||||
if (p.firstName.value == "") {
|
||||
message("Need a first name!!");
|
||||
return false;
|
||||
}
|
||||
if (p.lastName.value == "") {
|
||||
message("Need a last name!!");
|
||||
return false;
|
||||
}
|
||||
if (p.age.value == "") {
|
||||
message("Need an age!!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function message(m) {
|
||||
document.getElementById("wrapper").innerHTML = m;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user