feat(contact-form): implement consent checkbox and enable/disable submit button based on consent
This commit is contained in:
@@ -23,6 +23,54 @@ nav a:hover {
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Pagination */
|
||||||
|
.pagination {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination a,
|
||||||
|
.pagination span {
|
||||||
|
padding: 8px 12px;
|
||||||
|
text-decoration: none;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #007bff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination a:hover {
|
||||||
|
background-color: #007bff;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination .current {
|
||||||
|
background-color: #007bff;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pagination */
|
||||||
|
.pagination button {
|
||||||
|
padding: 8px 12px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
background-color: white;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.pagination button:hover {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
}
|
||||||
|
.pagination button:disabled {
|
||||||
|
background-color: #e9ecef;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
.pagination .current-page {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #007bff;
|
||||||
|
}
|
||||||
|
|
||||||
/* Admin newsletter */
|
/* Admin newsletter */
|
||||||
.filters {
|
.filters {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|||||||
@@ -74,6 +74,12 @@ button,
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button[disabled="true"],
|
||||||
|
.btn[disabled="true"] {
|
||||||
|
background-color: #cccccc;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
button:hover,
|
button:hover,
|
||||||
.btn:hover {
|
.btn:hover {
|
||||||
background-color: #0056b3;
|
background-color: #0056b3;
|
||||||
@@ -304,54 +310,6 @@ tr:hover {
|
|||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pagination */
|
|
||||||
.pagination {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pagination a,
|
|
||||||
.pagination span {
|
|
||||||
padding: 8px 12px;
|
|
||||||
text-decoration: none;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 4px;
|
|
||||||
color: #007bff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pagination a:hover {
|
|
||||||
background-color: #007bff;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pagination .current {
|
|
||||||
background-color: #007bff;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Pagination */
|
|
||||||
.pagination button {
|
|
||||||
padding: 8px 12px;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
background-color: white;
|
|
||||||
cursor: pointer;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
.pagination button:hover {
|
|
||||||
background-color: #f8f9fa;
|
|
||||||
}
|
|
||||||
.pagination button:disabled {
|
|
||||||
background-color: #e9ecef;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
.pagination .current-page {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #007bff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Utility classes */
|
/* Utility classes */
|
||||||
.text-center {
|
.text-center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -23,17 +23,32 @@
|
|||||||
<textarea id="message" name="message" required></textarea>
|
<textarea id="message" name="message" required></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="consent"
|
<input
|
||||||
>I agree to the processing of my submitted data.</label
|
type="checkbox"
|
||||||
|
id="consent"
|
||||||
|
name="consent"
|
||||||
|
required
|
||||||
|
style="display: inline-block; width: auto"
|
||||||
|
/>
|
||||||
|
<label for="consent" style="display: inline-block">
|
||||||
|
<span style="color: red">*</span> I agree to the processing of my
|
||||||
|
submitted data.</label
|
||||||
>
|
>
|
||||||
<input type="checkbox" id="consent" name="consent" required />
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit">Send Message</button>
|
<button id="contactSubmit" class="btn" type="submit" disabled="true">
|
||||||
|
Send Message
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div id="responseMessage"></div>
|
<div id="responseMessage"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
document
|
||||||
|
.getElementById("consent")
|
||||||
|
.addEventListener("change", function (e) {
|
||||||
|
const submitButton = document.getElementById("contactSubmit");
|
||||||
|
submitButton.disabled = !e.target.checked;
|
||||||
|
});
|
||||||
document
|
document
|
||||||
.getElementById("contactForm")
|
.getElementById("contactForm")
|
||||||
.addEventListener("submit", function (e) {
|
.addEventListener("submit", function (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user