-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (64 loc) · 2.77 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta tags -->
<meta charset="UTF-8">
<title>Contact Form</title>
<!-- Bootstrap CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
<!-- Summernote CSS -->
<link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="styles.css" rel="stylesheet">
<!-- jQuery and Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<!-- Summernote JS -->
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script>
</head>
<body>
<div class="container">
<!-- Heading -->
<h1>Contact Us</h1>
<!-- Contact Form -->
<form action="submit.php" method="post" id="contactForm">
<!-- Name input -->
<label for="name">Name:</label><br>
<input type="text" id="name" name="name" required><br><br>
<!-- Email input -->
<label for="email">Email:</label><br>
<input type="email" id="email" name="email" required><br><br>
<!-- Issue selection -->
<label for="issue">Issue:</label><br>
<select id="issue" name="issue" required>
<option value="Query">Query</option>
<option value="Feedback">Feedback</option>
<option value="Complaint">Complaint</option>
<option value="Other">Other</option>
</select><br><br>
<!-- Comment textarea -->
<label for="comment">Comment:</label><br>
<textarea id="comment" name="comment" rows="4" cols="50" required></textarea><br><br>
<!-- Submit button -->
<input type="submit" value="Submit">
</form>
</div>
<!-- Script to initialize Summernote and populate form fields if URL params exist -->
<script>
$(document).ready(function () {
// Initialize Summernote for the comment field
$('#comment').summernote();
// Check if URL parameters exist
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('name')) {
// Populate form fields with URL parameters
$('#name').val(urlParams.get('name'));
$('#email').val(urlParams.get('email'));
$('#issue').val(urlParams.get('issue'));
// Set Summernote content with HTML-decoded comment
$('#comment').summernote('code', urlParams.get('comment'));
}
});
</script>
</body>
</html>