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

    JotForm Login Auth (Javascript SDK): Not working on Safari 9 browser OSX - when you click the sign in button, it redirects back to the login form

    Asked by GPTQ on May 04, 2016 at 11:02 PM

    Hello,

     

    I am developing a pretty basic website that integrates JotForm. The website is setup so the user has to login to JotForm as soon as the page loads. Although, I noticed in Safari and some versions of IE, when I enter my JotForm credentials into the login box and hit login, it comes up with "Login successful, page redirecting", which is fine, but then it just switches back to the login page where I entered the credentials. It never gets to the page where I press Allow/Deny. Also, it never actually successfully logs in as I am still not able to use the FormPicker/Formbuilder.

     

    I have realised it is an error on my part, because when I test the JotForm login Demo in Safari on the JotForm Tools page, it works fine. And once I put my credentials into the JotForm Demo login, and then I reload the page on MY website, all of a sudden it pops up with the Allow/Deny, as though I successfully logged in.

     

    Anyway, I recreated the Jotform Login Demo with my own code and hosted on my own website, although the issue still persists. The entire code can be found below.

    What am I doing wrong?

     

    Thanks!

     

    --------

     

        <html>

        <head>

        <script src="//code.jquery.com/jquery-latest.js" type="text/javascript"></script>

        <script src='//js.jotform.com/JotForm.min.js'></script>

        </head>

        <body>

        <button id="jotformlogin">JotForm Login Demo</button>

        <div id="loginresults"></div>

       

        <script type="text/javascript">

        $("#jotformlogin").click(function(e) {

        JF.login(

        function success() {

        $("#loginresults").html("user authorized successfully");

        },

        function error() {

        $("#loginresults").html("error during authorization");

        }

        );

        });

        </script>

        </body>

        </html>

  • Profile Image
    JotForm Support

    Answered by ashwin_d on May 04, 2016 at 11:21 PM

    Hello GPTQ,

    I am not sure if I have understood your requirement correctly. Do you mean to say that you are trying to use any JotForm app and not ale to authorize and see the list of form?

    Can you please share a screenshot of the issue you are having? You may like to take a look at the following guide on how to upload image in forum post:  http://www.jotform.com/answers/277033 

    I would also request you to share your webpage URL where you have add the above JotForm login demo.

    We will wait for your response.

    Thank you!

  • Profile Image

    Answered by GPTQ on May 04, 2016 at 11:30 PM

    Hi Ashwin,

     

    Basically, my website allows users to choose (using a FormPicker) a form and edit it (using a FormBuilder), but they obviously have to authorize themselves in order to view the list of forms from the picker, hence why I have integrated the JotForm login. However, when using the site on Safari or IE, when the user types their JotForm details in and presses login, the login window just reverts page to the log in page, where you enter the details, and it never actually authorizes.

    I am not really sure what to take a screen shot of, as there is not error message, it simply keeps reverting back to the main login window.

    But here is my simple demo site so you can test it. I noticed it doesn't work on Safari on my iPad, and it doesn't work in SOME versions of IE. http://www.gptq.qld.edu.au/FormBuilder/tester.html 

     

    Thanks!

    Karl

  • Profile Image
    JotForm Support

    Answered by Chriistian on May 04, 2016 at 11:50 PM

    I see that you want to embed a form builder to your website. I tried to login to your demo site using Safari, and it appears that I was able to login successfully. I did not get reverted back to the login window.

    I believe it is possible to have a form builder on your website without the need to login by using Jotform Anywhere. You can use this feature so you can have a form builder on your site. Simply follow this link to learn how: http://www.jotform.com/anywhere/#quickUse 

    Here's a demo page where you can create your own form on the form builder: http://www.jotform.com/anywhere/demo/site_editor.php 

    Hope this helps. Please let us know if you need further assistance.

  • Profile Image

    Answered by GPTQ on May 05, 2016 at 12:14 AM

    Hi Chriistian,

     

    That's rather strange, I think it must be to do with the version of Safari or the operating system it's on, as Safari on my iPad and Safari on my iMac have the same issue. The version of Safari on my mac is 9.0.3, what's yours? I will also note that the version of IE that DOES NOT work is: 11.0.9600, however is DOES work on version: 11.0.10240

    I have attached a video of it not working for my on my Safari.

    Unfortunately since I need the users to pick from a list of existing forms, they will need to login and authorize themselves.

    Thanks!

  • Profile Image
    JotForm Support

    Answered by Chriistian on May 05, 2016 at 12:28 AM

    It does seem like the issue only occurs when using OSX. I tested the form on an OSX emulator within a Safari browser. I was able to replicate your issue there.

    The issue also seems to occur when viewing the page on Chrome browser in OSX. Please allow me some time to investigate this issue further and I will let you know on this thread once I have done so.
    Regards.

  • Profile Image

    Answered by GPTQ on May 05, 2016 at 12:34 AM

    Hi Chriistian,

     

    Thanks for looking into this for me, I appreciate it.
    The tricky thing is that the Login Demo on the JotForm works on all platforms, it just seems to be my website that doesn't work, even though there doesn't seem to be anything wrong with the code.

    Could it be something to do with the webserver I have it on?

    Karl

  • Profile Image
    JotForm Support

    Answered by Chriistian on May 05, 2016 at 01:21 AM

    It does seem like the issue only occurs on your website. I tested the login demo page on the osx emulator and I was able to successfully login.

    I checked your code again and I noticed that the src for the script does not have http. Just to make sure that we have all the bases covered, can you try changing the script from

    <script src='//js.jotform.com/JotForm.min.js'></script>

    to

    <script src='//js.jotform.com/JotForm.min.js'></script>

    OSX might read the source better if we have the full url, just in case.

    Please let us know if the issue still persists.

  • Profile Image

    Answered by GPTQ on May 05, 2016 at 01:44 AM

    Hi Chriistian,

     

    This JotForm reply editor seems to omit any occurrence of HTTP, (see your reply). I have changed my code so it reads HTTP before the library URL, however, the issue still persists. 

     

    Regards,

     

  • Profile Image
    JotForm Support

    Answered by Chriistian on May 05, 2016 at 02:15 AM

    I see that the issue still occurs. Thank you for confirming that you have changed the url to http.

    Another possible workaround we could try is to download the jotform.js and add that script to your server instead of using the http link.

    Hopefully this should resolve the issue on your website.

  • Profile Image

    Answered by GPTQ on May 05, 2016 at 02:22 AM

    Hi Chriistian,

     

    I have added the JotForm.js file to my server in the same folder as the HTML page, and replaced the reference to the JotForm.js file to the local version like you said.

    In my head tag I now have:

    <script type="text/javascript" src="JotForm.js"></script>

    Unforunately the issue still persists (see for youself). Sorry :/

    Thanks!

  • Profile Image
    JotForm Support

    Answered by Chriistian on May 05, 2016 at 02:48 AM

    I tested the login page on the OSX emulator again, and it appears that I was now able to login successfully. Adding the js file to your server seems to have worked. 

    Can you please try clearing the browser cache on your end then try logging in again?

  • Profile Image

    Answered by GPTQ on May 05, 2016 at 03:21 AM

    Hi Chriistian, 

     

    I cleared the cache multiple times and unfortunately, it still isn't working. Here is a video snippet of it not working still. I also included a video of it actually WORKING on Google Chrome on my iMac. Just if it helps.

    Thanks so much!

     

  • Profile Image
    JotForm Support

    Answered by Nik_C on May 05, 2016 at 04:12 AM

    I just did some tests on my iPad and I could replicate this error, on Safari it just reverts back to log in screen. But on Chrome, it is working fine.

    Let me do some more tests and I'll get back to you.

    Thank you!

     

  • Profile Image
    JotForm Support

    Answered by Nik_C on May 05, 2016 at 08:13 AM

    I did some checking of your website.

    This is what I found out from console:

    I found this thread in forum that is talking about the error you see there: http://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame

    As you can see in that thread, every browser blocks any script trying to access a frame with a different origin. I'm assuming that it is because your website is http and our forms are https by default.

    Could you please try to switch your website to https and test.

    I hope it will help.

    Will wait for your response.

    Thank you!

  • Profile Image

    Answered by GPTQ on May 05, 2016 at 07:24 PM

    Huh, that's strange I have never been able to retrieve those errors.
    Unfortunately, I do not have the ability to switch our site to https as I don't actually manage the site domain or certificates, and currently the site only supports HTTP. Surely this can't be the full cause of the issue can it, if it works on other browsers?

    Karl.

  • Profile Image
    JotForm Support

    Answered by EltonCris on May 05, 2016 at 08:30 PM

    Hello Karl,

    You're right. There is indeed a browser compatibility issue specifically on Safari 9 running on El Capitan OSX. I was able to reproduce it here.

    https://shots.jotform.com/elton/Screencast_08-18_06-05-2016.mp4

    I also tested your test page on Safari 8 running on Yosemite OSX and it is working just fine.

    https://shots.jotform.com/elton/Screencast_08-14_06-05-2016.mp4

    I have now raised this to our developers so they can further investigate and hopefully fixed this.

    We will let you know here once this is resolved.

    Thanks for your cooperation.

  • Profile Image
    JotForm Support

    Answered by EltonCris on May 05, 2016 at 08:55 PM

    Sorry, I spoke too soon. 

    I tested this issue using the login tool on the API page using the same browser - safari 9 and it is working fine there. So, I did probe further and hopefully the following would resolve this issue.

    The problem is, your HTML code is missing the DOCTYPE. Please add the following on the first line of your HTML code. This is necessary to ensure that the browser makes a best-effort attempt at following the relevant specifications needed for your code. In short, this tells the browser on how to interpret the HTML and CSS properly.

     

    Hope this helps!

  • Profile Image

    Answered by GPTQ on May 05, 2016 at 09:20 PM

    Hi Elton,

    Thanks for looking into this issue for me. I added <!DOCTYPE html> to the top of the code (see for yourself) and the issue still persists. Sorry!

     

    Karl.

  • Profile Image
    JotForm Support

    Answered by EltonCris on May 05, 2016 at 09:40 PM

    I am testing on this page http://www.gptq.qld.edu.au/FormBuilder/tester.html. It is working now.

    Perhaps it was cached. Can you please clear your safari browser's cache and cookies and try it again? Please try it and let us know.

    If you want, you can also test my version here https://shots.jotform.com/elton/testingLoginAPI.html. Nothing is changed, except the DOCTYPE added in the code.

  • Profile Image

    Answered by GPTQ on May 05, 2016 at 10:30 PM

    Hi Elton,

     

    Good and Bad news, it finally worked on my Safari 9 on my iMac. I have to clear the Cache and Cookies about 3 times and restart Safari a few times, but it eventually worked. However, it still does not work on the iPad, regardless of how many times I clear the cache, although I am going to ignore this for now as I am guessing it will probably work on other devices.
    Here's the Bad news; it still doesn't seem to work on IE 11.0.9600 on Windows 7. The same issue persists, although there is NO issue with your demo site, and the code is exactly the same. So I am really confused now.

  • Profile Image
    JotForm Support

    Answered by Chriistian on May 05, 2016 at 11:19 PM

    I am glad to know that the login is now working on Safari. However, it does seem odd that it doesn't work on IE, while my colleagues demo site works without any issue. I tried to login using Internet Explorer, and I also encountered the same issue.

    I checked the code on both pages and they seem to be similar, but the issue still persists on your page. Can you perhaps try restarting your server to see if that helps?

     

  • Profile Image

    Answered by GPTQ on May 05, 2016 at 11:29 PM

    It is very very strange. It sounds like some sort of cache issue, most likely on the server side. Unfortunately we cannot restart the server as it is our main website and the would result in an outtage for a period of time. Maybe it will eventually clear it's own cache over time?

     

    Karl.