templates/home/parts/contact_us.html.twig line 1
<style>
.user-box {
position: relative;
}
.user-box input {
width: 100%;
font-size: 16px;
color: #fff !important;
margin-bottom: 30px;
border: none;
border-bottom: 1px solid white !important;
outline: none;
background: transparent;
}
.user-box .form-control:focus {
color: black !important;
}
.user-box label {
font-size: 16px;
color: white;
}
.user-box-radio {
color: white;
}
textarea {
width: 100%;
}
/* Popup style */
.popup {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 20px;
border-radius: 8px;
text-align: center;
}
.popup.show {
display: block;
}
</style>
<div class="container bg-gradient-dark">
<div class="row">
<div class="col-12 col-md-4 mx-auto">
{{ form_start(form, {
'attr': {'class': 'py-5'},
'action': path('new_website_contact_from_contact_form')
}) }}
{{ form_widget(form._token) }}
<div class="user-box">
{{ form_row(form.firstName) }}
</div>
<div class="user-box">
{{ form_row(form.lastName) }}
</div>
<div class="user-box">
{{ form_row(form.email) }}
</div>
<div class="user-box">
{{ form_label(form.mobile, 'Phone', { 'label_attr': {'class': 'form-label'} }) }}<sup
style="padding-left:5px">*</sup>
{{ form_widget(form.mobile, { 'attr': {'class': 'form-control', 'required': 'required'} }) }}
</div>
{% if ProductService.getProductContactFormCount() > 1 %}
<div class="user-box-radio products_requested">
{{ form_row(form.productsRequested) }}
</div>
{% endif %}
<div class="user-box">
{{ form_label(form.notes, 'Message', { 'label_attr': {'class': 'form-label pr-5'} }) }}
{{ form_widget(form.notes, { 'attr': {'class': 'form-control', 'style': 'width: 100%', 'rows': '7'} }) }}
</div>
<button class="btn btn-outline-success mt-3" type="submit" onclick="showThankYouMessage(event)">Submit</button>
{{ form_end(form) }}
</div>
</div>
</div>
<!-- Popup message -->
<div id="thankYouPopup" class="popup">
<p>Thank you for your submission!</p>
</div>
<script>
function showThankYouMessage(event) {
event.preventDefault(); // Prevent form from submitting immediately
// Show the popup
document.getElementById('thankYouPopup').classList.add('show');
// Simulate form submission after a delay
setTimeout(function() {
// Here you can trigger the form submission after showing the popup
event.target.closest('form').submit();
}, 2000); // Delay to allow popup to be visible for 2 seconds
}
</script>