Open bwl21 opened 3 years ago
I tried to include the form again in the confirmation message
Ihre Meldung wurde verarbeitet.
{{insert_content::26857}}
but it appears that insert tags are not processed here.
Hallo,
I had a look into the sourcecode of the page. Maybe it can be solved in the script on the frontend
Maybe I can even append another script which every 5 seconds replaces the conformation text with the original form ... this is, what I will try first.
What do you think?
As a pity I have no experience with building Contao extensions, so I cannot prepare a PR.
I could solve the issue by adapting the template ajaxforms.html5:
var responsediv = form.querySelector('.ajaxformresponse');
if (responsediv) {
responsediv.innerHTML = "Ihre Eingaben werden versendet";
}
request('POST', form.action, formData, function () {
var location = this.getResponseHeader('X-Ajax-Location');
if (!location) {
form.innerHTML = form.innerHTML; // clear the form fields
var responsediv = form.querySelector('.ajaxformresponse');
if (responsediv) {
responsediv.innerHTML = this.responseText;
} else {
updateContent(form, this.responseText);
}
return;
}
request('GET', location, null, function () {
updateContent(form, this.responseText, location);
});
});
I have to add a field in the form with the class .ajaxformresponse
in which messages can be placed.
We are using this for feedbacks in an embedded video. If the form was submitted, it confirms the submission by showing the Text specified in the embedding element.
But how can I display the form in addition to the confirmation text such that the visitor can send another one.