Commit f32f41d8 authored by Philip Curley's avatar Philip Curley Committed by Rosemary Reilman
Browse files

Issue #3271291 by ikphilip: Recursion problem with embedded Webform

parent 8da12802
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -395,12 +395,15 @@

        // If user submits a form, count it as a conversion.
        // Stop the event, add our conversion cookie and then submit.
        modal.find('form').each(function () {
          $(this).on('submit', function (e) {
        function modalFormSubmitEventHandler (e) {
          e.preventDefault();
          setModalCookie(sessionModalConverted + modalId);
          $(this).off('submit', modalFormSubmitEventHandler);
          $(this).submit();
          });
        }

        modal.find('form').each(function () {
          $(this).on('submit', modalFormSubmitEventHandler);
        });

        // Reset the expiration on modal hide.