Skip to content

Commit 4736428

Browse files
committed
initial user-input-with-forms content
need to add additional chapter examples, exercises, and studio code
1 parent e9ee479 commit 4736428

File tree

5 files changed

+78
-0
lines changed

5 files changed

+78
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Form POST</title>
6+
<style>
7+
label {
8+
display: block;
9+
padding-bottom: 10px;
10+
}
11+
body {
12+
padding: 25px;
13+
}
14+
</style>
15+
</head>
16+
<body>
17+
<!-- Because method and action are set, a POST request will be sent to the action addess, with a message containing the field values.-->
18+
<form action="https://handlers.education.launchcode.org/request-parrot" method="POST">
19+
<label>Username <input type="text" name="username"></label>
20+
<label>Team Name <input type="text" name="teamName">
21+
</label>
22+
<button>Submit</button>
23+
</form>
24+
</body>
25+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Form Example</title>
6+
<style>
7+
label {
8+
display: block;
9+
padding-bottom: 10px;
10+
}
11+
body {
12+
padding: 25px;
13+
}
14+
</style>
15+
</head>
16+
<body>
17+
<!-- Form will use default action value and submit form to current page. -->
18+
<form action="">
19+
<label>Username <input type="text" name="username"></label>
20+
<label>Team Name <input type="text" name="team">
21+
</label>
22+
<button>Submit</button>
23+
</form>
24+
</body>
25+
</html>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Form Validation</title>
6+
<style>
7+
label {display: block;}
8+
body {padding: 25px;}
9+
</style>
10+
</head>
11+
<script>
12+
window.addEventListener("load", function() {
13+
let form = document.querySelector("form");
14+
form.addEventListener("submit", function(event) {
15+
alert("submit clicked");
16+
});
17+
});
18+
</script>
19+
<body>
20+
<form method="POST" action="https://handlers.education.launchcode.org/request-parrot">
21+
<label>Username <input type="text" name="username"></label>
22+
<label>Team Name <input type="text" name="team"></label>
23+
<button>Submit</button>
24+
</form>
25+
</body>
26+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//Add Your Code Below
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*/ Add your Code Below /*/

0 commit comments

Comments
 (0)