Bug: Embedded Form shows " attachEvent " Error due to Mutliple JS Files on Website

  • Profile Image
    kkotak
    Asked on October 21, 2013 at 01:48 AM

    Embed code on chrome 30.x gives the following JS error - Uncaught TypeError: Cannot read property 'attachEvent' of null



    This is a re-post of a comment on Which Form Embed Code Should I Use

  • Profile Image
    Elton
    Answered on October 21, 2013 at 03:45 AM

    Hi there!

    I'm not exactly sure where that error came from or its cause. May we know the website URL where your form is embedded so we can check it here? 

    You can also try embedding your form as iframe. This should not produce any possible conflict errors. How to get your iFrame Embed Code

    Thanks!

  • Profile Image
    kkotak
    Answered on October 21, 2013 at 01:16 PM

    Yes I am using iFrame option as a result. If you go to this URL  http://stage.primarq.com, you'll see the iFrame code loading the form correctly, but I also have left the embed code in there just before the iFrame code that produces the error. You can open up Firebug and see it. Nore that the error shows up also when there is no iFrame code there - so that's not the issue.

     

    Thanks,

     

    _K

     

  • Profile Image
    KadeJM
    Answered on October 21, 2013 at 02:40 PM

    Took me a few minutes but I actually found the form here http://stage.primarq.com/#/home-property-submission-homeowner on your website. 

    To my knowledge I know that strange errors and problems can happen if you have 2 Embedded Form Methods. Did you try it with just the iFrame originally and remove the other method?

     

    I did however, come across the " AttachEvent " Error which you are speaking about. I could see it at first but after doing a Test Re-embed using only the iFrame Code this went away on my end. Can you try again with only the iFrame to check this on your end?

  • Profile Image
    kkotak
    Answered on October 21, 2013 at 02:48 PM

    Sorry about the URL, I actually wanted to share the whole URL for the page.  

     

    But the error occurs even if I  only have the embed code in there.  You guys say that EMBED is the better way to do this but I am resorting to iFrame mode because it EMBED does not work due tto Attach Evevent error. May be your developer can take a look.

     

    _K

  • Profile Image
    Mike_T
    Answered on October 21, 2013 at 04:15 PM

    I am not getting the error when I use the JS code on my test page.

    Can you please remove the iFrame code and the JS code that is following it?

    So that we will have only one JS embed version of the form. Then, we will try to understand if the issue is related to the script conflicts or something else.

    Thank you.

  • Profile Image
    kkotak
    Answered on October 22, 2013 at 12:56 PM

    Ok. I have removed the suggested code. Here's the URL - http://stage.primarq.com/#/home-property-submission-homeowner. Still the same error.

    Thanks,

    _K

  • Profile Image
    KadeJM
    Answered on October 22, 2013 at 03:02 PM

    Thank you for trying and letting us know. We looked into this problem some more and I think that the problem is occurring due to the fact that you have server JS Files that are loading on your page which is creating a conflict thus causing our " attachEvent " handler command to fail. This in turn is making it look like the form is failing even though when it is used as a stand alone it is fine without error.

    At this point my knowledge is somewhat limited on how to fix this so it is a bit out of my hands. So what I am going to do is forward this to our Developers to double-check everything on a much deeper programming level just to be certain. We will update you about it here as soon as we know what is going on and if something can be done but this may take some time so we do appreciate any patience you can give us until then. 

     

    Screenshot of attachEvent from Jotform (failing):

     

    Screenshot of Several JS Files Found Loading in your Site:

  • Profile Image
    kkotak
    Answered on October 24, 2013 at 12:27 PM

    Hello - any update on this?

  • Profile Image
    kkotak
    Answered on October 25, 2013 at 03:20 PM

    Ok. Thanks for the response. Unfortuantely we can't leave the site up for too long for you guys to debug. We need to get working code (iframe) up there so we can make progress on our end. I hope you'e gathered enough info (Angular JS based app, etc.) for your dev team to debug.

    Best,

    _K

  • Profile Image
    Mike_T
    Answered on October 25, 2013 at 03:30 PM

    Thank you for your update.

    We will let you know as soon as we have any more information for you.

  • Profile Image
    Steve
    Answered on September 16, 2014 at 02:53 PM

    Hello-

    I tried to reproduce this issue and could not. Please let us know if you still encounter a problem.

    Thanks

  • Profile Image
    akkdio
    Answered on November 12, 2014 at 06:28 AM

    I am having this error.  You can see it here:

    http://www.ealtd.com/home/contact_us
  • Profile Image
    Ben
    Answered on November 12, 2014 at 09:02 AM

    Hi @akkdio,

    I have moved your question to another thread since this thread had been started in 2013.

    Please make your future responses there and we will be answering you on that thread shortly.

    You can find it here: http://www.jotform.com/answers/458011

    Best Regards,
    Ben