Let’s say when a user click the “Send” button on a Marketo form, you would like to display a notification that asks the user if “Is it really ok to send”?. This possible by implementing a few lines of JavaScript, which will show a confirmation box when somebody clicks the Send button.
Here’s an example of how to do this. Add the onSubmit function to your Marketo form as shown below. For more information about Marketo Forms API, please check out the developer documentation.
1 2 3 4 5 6 7 8 9 10 11 |
<script src="//app-e.marketo.com/js/forms2/js/forms2.js"></script> <form id="mktoForm_19"></form> <script> MktoForms2.loadForm("//app-e.marketo.com", "212-RBI-463", 19,function(form){ //Add this function to your Marketo form script form.onSubmit(function(){ alert("Do you really want to submit the form?"); }); }); </script> |