Hi,
What do you mean by "EPiServer is not doing normal form submission"? What kind of approaches you tried before already?
Hi,
I'm not sure. I am able to capture the form post when I change "injectFormOwnJQuery" = false, however, that breaks the form validation. I have also tried to alter the form to have a onSubmit javascript method but no luck.
I have tried the following using jQuery:
$(function() {
$('#formID').on('submit', function(e) {
alert('testing');
e.preventDefault();
});
$('#formID').submit(function(e) {
alert('testing');
e.preventDefault();
});
$('#formID').submit(function() {
alert('testing');
e.preventDefault();
});
});
Hi,
It is easily to capture Form submiting event in clientside. You don't have to alter Forms Javascript API or do anything special because Forms raise suitable events. Please read this article with sample code http://world.episerver.com/add-ons/episerver-forms/handling-events-for-episerver-forms/
PS: This is not a solution to your problem. Just some extra info.
You should set configuration of "injectFormOwnJQuery"=false only if you already have jQuery in your site (and you don't want another jQuery instance of Forms), Please read this article https://medium.com/@lockevn/speed-up-episerver-forms-in-view-mode-2a8a05911ff3#.e6ca392fq for more information.
I'm looking to capture the form submit event in my javascript so that I can push Google Tag Manager data out to Google. I've tried every combination of events however it looks like EPiServer is not doing a normal form submission. Can you point me in the direction to capture this event?
On submit I will capture all of the element values and insert them into GTM datalayer push. I've can accomplish this just not on form submission.
Thanks!