Skip to content

Commit b69b4b2

Browse files
committed
Added Basic Contact Form
Added #202
1 parent 5c4a93f commit b69b4b2

File tree

5 files changed

+180
-2
lines changed

5 files changed

+180
-2
lines changed

Basic Contact Form/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<h1>Basic Contact Form</h1>
2+
3+
<p>A Basic Contact Form written in HTML, CSS and JAVASCRIPT .</p>
4+
5+
### Use of the Project:
6+
7+
<p>This basic contact form can be added to any website to make it attractive. </p>
8+
9+
<h3>Used Technologies</h3>
10+
<ul>
11+
<li>HTML5</li>
12+
<li>CSS3</li>
13+
<li>JavaScript</li>
14+
</ul>
15+
16+
#### Steps to Use:
17+
18+
---
19+
20+
- Download or clone the repository
21+
22+
```
23+
git clone https://github.com/Ayushparikh-code/Web-dev-mini-projects.git
24+
```
25+
26+
- Go to the directory
27+
- Run the index.html file
28+
- Result is here!!!
29+
30+
<h3> Screenshot:</h3>
31+
<img src="https://user-images.githubusercontent.com/66966120/125250300-ec32c500-e2aa-11eb-8a50-31d4cf729d72.png" alt="Screenshot (19)" style="max-width:100%;">
32+
33+
34+
<h3> Demo </h3>
35+
36+
<a href="https://sonamgupta136.github.io/Basic-Contact-Form.io/">Demo</a>
37+
38+
<br>
39+

Basic Contact Form/app.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
let sendButton = document.getElementById('send');
2+
let resetButton = document.getElementById('reset');
3+
let form = document.getElementById('form');
4+
5+
6+
form.addEventListener('submit', function (e) {
7+
e.preventDefault();
8+
})
9+
10+
resetButton.addEventListener('click', function () {
11+
let name = document.getElementById('name');
12+
let email = document.getElementById('email');
13+
let message = document.getElementById('message');
14+
15+
name.value = '';
16+
email.value = '';
17+
message.value = '';
18+
})
19+
20+
sendButton.addEventListener('click', function (e) {
21+
let name = document.getElementById('name');
22+
let email = document.getElementById('email');
23+
let message = document.getElementById('message');
24+
25+
name = name.value;
26+
localStorage.setItem('name', name);
27+
28+
email = email.value;
29+
localStorage.setItem('email', email);
30+
31+
message = message.value;
32+
localStorage.setItem('message', message);
33+
34+
})
35+

Basic Contact Form/index.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<link rel="stylesheet" href="style.css">
9+
<title>Contact Form</title>
10+
</head>
11+
12+
<body>
13+
<form id="form">
14+
<h1>Please Contact me</h1>
15+
<div>
16+
<label for="name">Name</label></br>
17+
<input id="name" name="name">
18+
</div>
19+
<div>
20+
<label for="email">Email</label><br>
21+
<input type="email" id="email" name="email">
22+
</div>
23+
<div>
24+
<label for="message">Message</label><br>
25+
<textarea id="message" name="message"></textarea>
26+
</div>
27+
<div id="buttons-row">
28+
<div class="buttons">
29+
<button type="submit" id="send">Send</button>
30+
</div>
31+
<div class="buttons">
32+
<button id="reset">Reset</button>
33+
</div>
34+
</div>
35+
</form>
36+
<script src="app.js"></script>
37+
</body>
38+
39+
</html>
40+

Basic Contact Form/style.css

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
form {
2+
background-color: black;
3+
width: 500px;
4+
border-radius: 25px;
5+
height: 400px;
6+
padding: 25px;
7+
font-family: Arial, Helvetica, sans-serif;
8+
box-sizing: border-box;
9+
margin: 50px auto 50px;
10+
11+
}
12+
13+
form h1 {
14+
color: white;
15+
text-align: center;
16+
font-size: 22px;
17+
}
18+
19+
label {
20+
color: rgb(43, 134, 209);
21+
font-weight: bold;
22+
padding-bottom: 5px;
23+
padding-top: 15px;
24+
display: inline-block;
25+
}
26+
27+
input,
28+
textarea {
29+
box-sizing: border-box;
30+
width: 450px;
31+
height: 30px;
32+
padding-left: 5px;
33+
font-family: Arial, Helvetica, sans-serif;
34+
}
35+
36+
textarea {
37+
height: 50px;
38+
}
39+
40+
#buttons-row {
41+
display: flex;
42+
justify-content: space-evenly;
43+
}
44+
45+
button {
46+
flex-grow: 1;
47+
width: 125px;
48+
margin: 25px;
49+
border: none;
50+
border-radius: 15px;
51+
height: 35px;
52+
font-size: 20px;
53+
}
54+
55+
button#send {
56+
background-color: rgb(211, 59, 59);
57+
color: white;
58+
}
59+
60+
button#reset {
61+
background-color: rgb(253, 253, 54);
62+
color: black;
63+
}
64+

Index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
| [ConnectFour](https://github.com/Shauryaditya/Web-dev-mini-projects/tree/main/ConnectFour) | This is a simple game which can be played between two players.The player who connects the four bubbles first wins the game . The bubbles could be connected horizontally , vertically or diagonally.The players have to be together since multiplayer feature is not available .|
6060
| [Expand Button](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Expand-Button) |It is a basic website with an expanding button on it. As we click on the button it expands and shrinks after 5 seconds. |
6161
| [Color Guessing Game](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/color-guessor) |It is a basic color guessing game where the player is given a rgb value and he has to guess the color from that.|
62-
| [Double Vertical Slider](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Double-Vertical-Slider) | This App helps to Slide the two different parts of the webpage content at the same time . |
63-
| [Basic Contact Form](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Basic-Contact-Form) | A basic contact form having send and reset button. |
62+
| [Double Vertical Slider](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Double-Vertical-Slider) | This App helps to Slide the two different parts of the webpage content at the same time .|
6463
| [Compound Interest Calculator](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Compound%20Interest%20Calculator) | A basic gradient Background Generator which allows you to create a background by selecting your required colors. This will make up a gradient mix and provide you the code line so that you can use it in your Website |
6564
| [Youtube UI Clone](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Youtube-Clone) | A project which aims to clone YouTube UI with responsiveness by using HTML & CSS. |
6665
| [Blog Application](https://github.com/khushi-purwar/Web-dev-mini-projects/tree/main/Blog%20Application) | Blog Application is an application where user can add a new blog, edit it, delete it as well as view other blogs and make changes in them. |
@@ -72,3 +71,4 @@
7271
| [Blackjack Game](https://github.com/TheArushiSingh/Web-dev-mini-projects/tree/main/Blackjack%20Game) | The player has to get a hand with a value as close to 21 as possible without going over. A hand that goes over 21 is a bust. Each player has to beat the dealer's hand in order to win. |
7372
| [Tribute Page](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/TRIBUTE%20PAGE) | This is a tribute web page for covid warriors. Have built it using HTML, CSS, JAVASCRIPT. |
7473
| [BMI Calculator (Flask)](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/BMI%20Calculator%20(Flask))|This is a simple BMI calculator built using HTML, CSS, Python and Flask framework.|
74+
| [Basic Contact Form](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Basic-Contact-Form) | A basic contact form having reset and send button. |

0 commit comments

Comments
 (0)