Edit: Construction page and media
This commit is contained in:
@@ -21,16 +21,17 @@
|
||||
<input type="email" class="form-control text-dark" id="email" name="email" placeholder="{{ i18n "ph_email" }}" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="phone">Telefoonnummer</label>
|
||||
<input type="tel" class="form-control text-dark" id="phone" name="phone" placeholder="Bijv. 0612345678">
|
||||
<label for="phone">{{ i18n "phone" }}</label>
|
||||
<input type="tel" class="form-control text-dark" id="phone" name="phone" placeholder="{{ i18n "ph_phone" }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="reason">Reden van contact</label>
|
||||
<label for="reason">{{ i18n "contact_reason" }}</label>
|
||||
<select class="form-control text-dark" id="reason" name="reason" required>
|
||||
<option value="" disabled selected>Maak een keuze...</option>
|
||||
<option value="Kavel laten toetsen">Kavel laten toetsen</option>
|
||||
<option value="Aanmelden nieuwsbrief">Aanmelden nieuwsbrief</option>
|
||||
<option value="Zakelijk">Zakelijk</option>
|
||||
<option value="" disabled selected>{{ i18n "option_choose_reason" }}</option>
|
||||
<option value="Kavel laten toetsen">{{ i18n "option_plot_check" }}</option>
|
||||
<option value="Aanmelden nieuwsbrief">{{ i18n "option_newsletter" }}</option>
|
||||
<option value="Zakelijk">{{ i18n "option_business" }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
@@ -62,16 +63,17 @@ document.getElementById('contact-form').addEventListener('submit', function(e) {
|
||||
const reason = document.getElementById('reason').value;
|
||||
const message = document.getElementById('message').value;
|
||||
|
||||
// We combineren de reden en het bericht voor het 'description' veld in EspoCRM
|
||||
// We combineren de reden en het bericht voor de 'description'
|
||||
const fullDescription = "Reden van contact: " + reason + "\n\nBericht:\n" + message;
|
||||
|
||||
// De payload met de nieuwe website parameter
|
||||
const payload = {
|
||||
"firstName": document.getElementById('fname').value,
|
||||
"lastName": document.getElementById('lname').value,
|
||||
"emailAddress": document.getElementById('email').value,
|
||||
"phoneNumber": document.getElementById('phone').value,
|
||||
"description": fullDescription,
|
||||
"salutationName": "" // Je kunt dit leeg laten als je het hebt opgelost
|
||||
"website": window.location.href // Hiermee wordt de volledige URL van de huidige pagina verstuurd
|
||||
};
|
||||
|
||||
fetch('https://crm.start-it.nl/api/v1/LeadCapture/1eeab8e3c9f41fd45419a012fb8696ac', {
|
||||
@@ -100,7 +102,7 @@ document.getElementById('contact-form').addEventListener('submit', function(e) {
|
||||
})
|
||||
.finally(() => {
|
||||
btn.disabled = false;
|
||||
btn.innerText = originalBtnText;
|
||||
btn.innerText = '{{ i18n "send" }}';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user