Atomic Form features #35674
aksellno
started this conversation in
Feature Request
Replies: 1 comment
|
I used the code below to handle the redirect after submission Add this to the code snippet: <script>
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('[data-element_type="e-form"]').forEach(form => {
let alreadySuccess = false;
const observer = new MutationObserver(() => {
const isSuccess = form.classList.contains('form-state-success');
if (isSuccess && !alreadySuccess) {
alreadySuccess = true;
form.dispatchEvent(
new CustomEvent('atomic_form_success', {
bubbles: true,
detail: {
form: form
}
})
);
}
if (!isSuccess) {
alreadySuccess = false;
}
});
observer.observe(form, {
attributes: true,
attributeFilter: ['class']
});
});
});
</script>How to use: <script>
document.addEventListener('atomic_form_success', function (event) {
window.location.href = '/thank-you/';
});
</script> |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the Problem
The current version of the Atomic Form is missing some features present in the Form for V3.
First off the reply to address. In v3 you are able to select the sender e-mail as a reply-to adress. Now no variables are possible, at least not in any official documentation, and the dynamic tags are not relevant for the form fields.
Second is action after submit. Right now only collect submissions and email are possible actions.
Propose a Solution
I suggest that the dynamic tags for the fields like reply-to should have available form fields as dynamic, or at least a shortcode support to be able to add the sender email fields into the reply-to field.
And the action after submit should support redirect, to be able to redirect to e.g "Thank you page"
Additional Context
No response
Agreement
All reactions