-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewform.html
97 lines (77 loc) · 3.59 KB
/
newform.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.form-label::after{
content: " *";
color: red;
}
</style>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<title>Document</title>
</head>
<body>
<div class="container-sm">
<label class="fw-bold">Webinar Registration</label>
<form id="myForm">
<div class="mb-3">
<label class="form-label fw-bold">Name</label>
<div class="row" required>
<div class="col-md mb-2"><input class="form-control" placeholder="First Name" id="firstname"></div>
<div class="col-md "><input class="form-control" placeholder="Last Name" id="lastname"></div>
</div>
</div>
<div class="mb-3"required>
<label class="form-label fw-bold" id="email">Email</label>
<input type="email" placeholder="abc@123.com" class="form-control">
</div>
<div class="mb-3"required>
<label class="form-label fw-bold" id="companyname">Company Name</label>
<input type="text" class="form-control">
</div>
<div class="mb-3"required>
<label class="form-label fw-bold" id="companysite">Company Website</label>
<input type="text" class="form-control" placeholder="www.google.com">
</div>
<div class="mb-3">
<label class=" fw-bold">Address</label>
<div class="row">
<div class="col-md mb-2"><input type="text" class="form-control" placeholder="Street Address"></div>
<div class="col-md "><input type="text" class="form-control" placeholder="Apartment,Suite"></div>
</div>
<div class="row mt-3">
<div class="col-md mb-2"><input type="text" class="form-control" placeholder="City"></div>
<div class="col-md"><input type="text" class="form-control" placeholder="State"></div>
</div>
<div class="row mt-3">
<div class="col-md mb-2"><input type="number" class="form-control" placeholder="Postal Code"></div>
<div class="col "><select class="form-select">
<option selected>Country</option>
<option value="1">India</option>
</select></div>
</div>
</div>
<div class="d-grid">
<input type="submit" class="btn btn-primary " value="Submit ">
</div>
</form>
</div>
<script>
let form=document.querySelector('#myForm');
form.addEventListener('submit',function(event){
event.preventDefault();
let firstname=document.querySelector('#firstname').value;
let lastname=document.querySelector('#lastname').value;
let data={firstName:firstname,lastName:lastname};
fetch('http://localhost:3000/submit',{
method:'POST',
body:JSON.stringify(data),
headers:{'Content-type':'application/json'}
});
});
</script>
</body>
</html>