Custom Form with out redirect.
We have a simple form built in Acoustic which collects a user's email, however, upon submitting the form it redirects the user to a different page.
We would like to create a custom form that collects the email but does not redirect the user and clears to reveal a success/thank you message.
We are attempting to code our own form but need help with the API documentation, specifically where to pass the data to once we've captured it on our side.
-
Did you include the <form> in an external page?
If yes, you can include a target in the <form> tag (action, pageID, siteID, parentPageId from your form):
<form method="post" action="https://www.pages04.net/migros/bloghotelplanch-BlogUpdatefr/Opt-in" pageId="22899863" siteId="564118" parentPageId="22899862" class="grid-x align-middle" target="frame">
Then include a message you want to show as confirmation:
<div id="confirmation" class="confirmation">
Confirmation message
</div>And an iFrame where the message is shown:
<iframe id="frame" name="frame" style="display:none"></iframe>
Then show/hide it with JS/jQuery:
$('footer .blog-subscription #confirmation').hide();
$('footer .blog-subscription form').submit(function() {
$('footer .blog-subscription .content').hide();
$('footer .blog-subscription .form').hide();
$('footer .blog-subscription #confirmation').show();
});The content from #confirmation will then be shown in the iFrame and it's displayed by jQuery.
If you don't have it on an external page I think there's an option in Acoustic that you want to show the message on the same page and don't redirect on a new one.
Please sign in to leave a comment.
Comments
1 comment