1

I'm using Fireform.org to for collecting data from a form. But I cannot seem to get an event listener or anything to happen when the form is submitted (submits to fireform just fine).

Tried the following methods already to no avail:

using action="javascript"

<form id="contactForm" action="javascript:confirmSubmit();" method="post" class="nobottommargin">

using onsubmit="":

<form id="contactForm" onsubmit="confirmSubmit()" method="post" class="nobottommargin">

using jquery using .on as well as .submit : function confirmSubmit() { alert("hello"); }

                    $( "#contactForm" ).on("submit", function() {
                      alert("hello me ");
                    });

                    $('#contactForm').submit(function(){
                        confirmSubmit();
                    });
                </script>

What I want is to trigger a confirmation message when the form is submitted (this is a static page, no backend PHP processes available, only javascript). The form is submitting to Fireform.org just fine.

Ans.
  • 11
  • 1
  • What is your console telling you when you submit the form? Any errors? – user2867288 May 30 '15 at 03:32
  • The only things in the console are from the fireform.org API. There's nothing that's related to any of the event listeners I put in. `Use of docuemnt.creatAttribute() is deprecated. Use element.setAttribute() instead.` `Use of setAttributeNode() is deprecated. Use setAttribute() instead.` – Ans. May 30 '15 at 18:16
  • Where are you defining your confirmSubmit function? Is this what you mean? https://jsfiddle.net/L18nnhfc/ – user2867288 May 30 '15 at 20:31
  • I've tried defining the function in multiple places, including separate custom.js file which is loaded on the HTML before (have other jquery event listeners on this file that work fine so this js file is loading properly. Also tried defining the function directly on the HTML doc using script tags, both in the header as well as after the . I can call the function directly through the console but just, not through an event listener. – Ans. May 31 '15 at 02:14
  • it's just a simple test function right now. – Ans. May 31 '15 at 02:15
  • You have a link to your page? – user2867288 May 31 '15 at 19:03

0 Answers0