AnsweredAssumed Answered

Conditional Return: false on Marketo Forms

Question asked by Lucho Soto on Aug 23, 2018
Latest reply on Aug 24, 2018 by Sanford Whiteman

I have the following custom form code that displays a thank you message on submit without reloading the page. I'd like to take this a step further and make this conditional. If the field C_Service_Reason is submitted with the value Training, then I don't want the thank you message to display, and instead want them to be redirected to an external URL on success.


Any help with this would be much appreciated, thank you!


<script ></script>
                    <form id="mktoForm_2338"></form>
                    <script>MktoForms2.loadForm("//", "980-GBD-747", 2338);</script>
                        MktoForms2.whenReady(function (form){
                            //Add an onSuccess handler
                            form.onSuccess(function(values, followUpUrl){ 
                                    'event': 'contacttest',
                                    'eventCallback' : function () {         
                                        document.getElementById('contacttest').style.visibility = 'visible'; 
                                return false;
                    <div id="contacttest" style="visibility:hidden; text-align: center;">Thank you for your interest! A Hatch expert will be in touch soon.</div>