'); window.formAnswer = firstRandom + secondRandom; } else { sendForm = true; } } else if ($(fallbackAnswer).attr("required") === "required") { if ($(fallbackAnswer).val() != window.formAnswer) { var firstRandom = Math.floor(Math.random() * 11); var secondRandom = Math.floor(Math.random() * 11); $(fallbackAnswer).attr("placeholder", firstRandom + " + " + secondRandom); $(fallbackAnswer).addClass("is-invalid"); window.formAnswer = firstRandom + secondRandom; $(fallbackAnswer).val(""); } else { $(fallbackAnswer).remove(); sendForm = true; } } else { sendForm = true; }*/ if (sendForm) { $("#jobformLoon--alert-info").remove(); alertBox("form-sending-message", "alert-info", "Een moment geduld Uw sollicitatie wordt verzonden..."); var formData = new FormData(); $.each($('#jobformLoon input, #jobformLoon textarea'), function () { var fieldName = this.id !== "" ? this.id : this.name; var fieldValue = ""; if (this.type === "checkbox") { fieldValue = this.checked; } else if (this.type === "file") { var cvFile = this.files[0]; if (cvFile !== undefined || cvFile !== null) { fieldValue = cvFile; } } else { fieldValue = this.value; } formData.append(fieldName, fieldValue); }); $.ajax("/umbraco/surface/forms/jobformapplication", { type: "POST", enctype: 'multipart/form-data', cache: false, contentType: false, processData: false, data: formData, success: function (message) { $("#jobformLoon--alert-info").remove(); if (message !== null) { alertBox("form-message-sent", "alert-success", "Sollicitatie verzonden! " + message); $(jobformLoon)[0].reset(); }, error: function (data) { alertBox("form-message-failure", "alert-danger", "Error! Er ging iets mis bij het verzenden van het bericht. Probeer het nogmaals of neem direct contact op met info@kizgroep.nl
Error message: " + data + ""); } }); } else { alertBox("form-persona-failure", "alert-info", "You haven't proven you're a human yet."); } }); const formsTabButtons = $('#form-selection .tab-button'); $('#form-selection .tab-button').click(function () { $(formsTabButtons).each(function () { $(this).removeClass('active'); var dataId = $(this).attr('data-id'); $('#' + dataId).addClass('d-none'); }); $(this).addClass('active'); var dataId = $(this).attr('data-id'); $('#' + dataId).removeClass('d-none'); });