Console error on success pop-up.

  • johnsonvillemedicalcentre
    Asked on August 19, 2016 at 1:13 AM

    I'm trying to create a pop-up success message as described in https://www.jotform.com/answers/809359-I-want-a-pop-up-thank-you-page-instead-of-redirect

    I've followed the instructions as given, however the page is still redirecting on success.

    In the console I get a $$ is not defined for the line:

    var myform = $$('form')[0];

    within the submission script advised.

    I thought it was to do with jquery not loading but everything else is working ok and that's running before the form script.

    Where should I be looking next to try and fix this?

     

  • Chriistian Jotform Support
    Replied on August 19, 2016 at 4:36 AM

    I checked the code that you shared and they all seem to be setup correctly. Perhaps there is conflict within jotform and your other libraries which is causing the error on your console. Can you please try adding the script <script>jQuery.noConflict();</script> on top of of the "var myform = $$('form')[0]" script.

    It should look like the example script below:

    <script>jQuery.noConflict();</script>

    <script type="text/javascript">

    $(document).ready(function(){

      var myform = $$('form')[0];

      myform.onsubmit = function() {

    ......................................

    </script>

    If the issue persists, please let us know. If the page is live, you can also share with us the url so we may check it there. Thank you.