- GlobeTechnicalAsked on March 09, 2013 at 02:00 AM
I'm wondering whether there's any suitable workaround to this problem yet. As I can see from looking through previous forum posts, quite a few people have experienced or are experiencing the same issue.
For clarity's sake (and for anyone reading this who hasn't already read through all the other posts on the same topic) the problem is as follows:
I have a JotForm form embedded on the 'Contact' page on my website. The form is hosted locally in order to reduce load times. When viewing the page in IE8, the page loads up ok but with errors indicated in the bottom left hand corner of the browser window. When the visitor tries to leave or refresh the page, they are presented with a 'Stack Overflow' error. Internet Explorer dev console seems to think that line 1830 of the prototype script is responsible.
I also get a "'handler' is null or not an object" error @ line 5602 of the prototype script.
Another suggestion I've spotted is to use a command that effectively tells the browser that there is no error - even though there is. This is not a viable solution. I have also tried embedding my form in an iframe but this messes up the formatting of my form.
So...I would like to know if there are any other workarounds or fixes available (or planned) for this problem. failing that, please advise on the correct procedure for embedding a locally hosted JotForm form in an iframe in such a way that the formatting of my form will be unaffected - it is possible that I'm doing something wrong. Either way, I really need to get this working and I'm sure many others are in a similar position.
- JotForm SupportWelvinAnswered on March 09, 2013 at 09:26 AM
The iframe method should always work and solved issues like this. Can you please try it again and let us know so we can check it also on our end.
But before that, please kindly try doing this methods;
1. Edit your doctype declaration into this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2. Add this below the <title></title> tag of your webpage:
<!--[if lt IE 8]> <script src="//ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script> <![endif]-->
<!--[if lt IE 9]> <script src="//ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script> <![endif]-->
I hope this works.
- JotForm Supportardy0689Answered on March 09, 2013 at 10:59 AM
The above suggestion by my colleague should fix the error. I have to agree with him that using IFRAME embed method will put the JotForm in a protected section to avoid interfering with the parent code. Thus, fixing conflicts along the way.
Just in case it does not work a good workaround is still the jQuery.noConflict();
I have reviewed your webpage and the best location for your jQuery.noConflict(); is to your head tag
Since you injected from the head it will be applied to all of the web page. Please do this along with the re-embed of the IFRAME method.
Please let us know if this works.
- JotForm SupportabajanAnswered on March 09, 2013 at 11:47 AM
Exactly what function is jQuery performing on the Contact page? I downloaded the page and removed all of the jQuery references and haven't noticed any difference as yet. If there's no purpose for its existence there, just removing it would solve the problem.
- JotForm SupportabajanAnswered on March 09, 2013 at 11:48 AM
Well, there was actually just one reference to jQuery.
- GlobeTechnicalAnswered on March 09, 2013 at 01:27 PM
@Welvin - Webmatrix has the following to say about the !DOCTYPE declaration you suggested:
"This document type is not supported. IntelliSense and validation for this document type will be based on HTML 5."
I tried it anyway, along with the 2 IE hack scripts you suggested. Didn't work. Additionally, you're effectively commenting out both of those sections of code anyway. Did you want me to do something in particular with them before including them on my page?
@ardy0689 - The iframe embed method you linked to doesn't explain how to get this working with a locally hosted form. If I change the url referenced in the embed code to point to the local copy of the form on my PC, the form does display but with all formatting removed. This is why I was asking in my OP whether there's a special trick to getting iframes working without messing with the formatting of the form.
@abajan - I actually didn't provide a link to the live version of my website. While I certainly don't mind you taking a look, I should mention that the live site is still pointing to the form on your servers and not a locally hosted copy - since I haven't uploaded the changes yet (and wasn't planning to until I can get this issue sorted).
You are correct...there is currently only one script that is calling jQuery. It is a necessary script, however, and I will likely add more functionality to the site that requires jQuery at a later date.
Don't get me wrong - I really do appreciate your help...but the problem persists...happy days. Looking forward to your response.
- JotForm Supportardy0689Answered on March 09, 2013 at 01:59 PM
Hi Leon, I think you almost got the implementation with the IFRAME. Changing the URL to point on your local form is the right thing to do but you forgot to include the stylesheets on the page you are pointing.
Have all the CSS codes that are related to your form to put into one stylesheet, we can call it myform.css. You put all your customized Jotform CSS codes in it.
Next thing you need to do is to attach or link this on your local hosted copy.
Let us say your local hosted form is embedded in http://mydomain.com/storage/jotform-static.html.
You need to open this html file and have the form stylesheet attached to the head. This will be your proxy page.
...some stylesheets links
<link rel="stylesheet" target="_blank" href="Styles/myform.css" type="text/css" />
.....your jotform normal embed code or the whole source code here
Now all you need to do is embed an IFRAME in your contact us page pointing to your proxy page.
This should prevent your styles from being destroyed.
- GlobeTechnicalAnswered on March 09, 2013 at 03:46 PM
@ardy0689 - but the stylesheet(s) are already included in the <head> of the page and my injected code is inline with the html, as follows:
I have not changed the code on this page after downloading it other than to change the directories for the scripts so that they point to my local copies.
Can you spot where I'm going wrong?
- JotForm SupportEltonCrisAnswered on March 10, 2013 at 06:08 AM
On your form source code, find these scripts
and replace it with this.
You can check my demo on this page using your IE8 browser. https://shots.jotform.com/elton/fix_error_ie_189966.html
The browser still indicates an error but it's no longer an issue with JotForm, it's probably with the NavArrow2.js .default subproperty.
- GlobeTechnicalAnswered on March 10, 2013 at 10:41 PM
@EltonCris - ...but if I do that then surely we're back to pulling the form (or at least the bulk of it) down from your servers? I've chosen to host the form locally for performance reasons. Otherwise the page takes 1-2 seconds to load up.
How about if I were to copy the contents of 'g=jotform' (which appears to be the script you're calling), paste them into a new .js file and put that in my local 'Form' folder and then link to it instead of linking to an external site? Would that work? If not, is it possible for me to download and keep a local copy of whatever other files/scripts are involved?
Either way, I'd be curious to know a little background as to what this alternative script does, if possible.
Re: '.default' error - thanks for the heads-up, I'm aware of this error.
- JotForm SupportEltonCrisAnswered on March 10, 2013 at 10:50 PM
Yes, you can do that. Copy the js code and save it as .js file. Upload it to your server and use it on your page.
Well I would say it boost up the loading process since they are loaded all at once and it's more updated I guess than on the downloaded source. Give it a try and let us know what your results are. Thanks!
- GlobeTechnicalAnswered on March 11, 2013 at 04:10 AM
That seems to work.
Thanks for your help.
- JotForm SupportEltonCrisAnswered on March 11, 2013 at 06:46 AM
Glad it helps!
Should you need any assistance with JotForm, feel free to reach us here anytime.