What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

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

    Asked by kkotak 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
    JotForm Support

    Answered by EltonCris 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

    Answered by kkotak 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
    JotForm Support

    Answered by KadeJM 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

    Answered by kkotak 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
    JotForm Support

    Answered by Mike_T 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

    Answered by kkotak 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
    JotForm Support

    Answered by KadeJM 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

    Answered by kkotak on October 24, 2013 at 12:27 PM

    Hello - any update on this?

  • Profile Image
    JotForm Support

    Answered by guilledutra on October 24, 2013 at 01:51 PM

    Hi,

    Unfortunately we don't have news about the status of this issue, however I can see that the priority of this ticket was changed to Important, as soon as we get news about its status we will let you know.

    Thanks for your patience.

  • Profile Image

    Answered by kkotak 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
    JotForm Support

    Answered by Mike_T 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
    JotForm Support

    Answered by steve 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

    Answered by akkdio 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

    Answered by Ben 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