• Hey guys

    Got an issue with a html form on my site.

    So on a desktop in chrome the form submits fine and gives me a thank you pop alert and redirects to a page however on Safari it just clears the form. Not sure if it’s a conflict with something or there is a better way to program the form.

    I’m using raw html for the form and code snippets plug-in to put the JavaScript in the head.

    • This topic was modified 2 years, 7 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Hi @darrellwilde,

    I wasn’t able to submit the form in both Chrome and Safari browsers. When I submit, it just clears my form.
    However, a couple of errors are being flagged on submit in the Network tab of Safari’s Developer Tools.

    "errors": [
            "Unexpected extra form field named \"aEyFekStThd\".",
            "Unexpected extra form field named \"ZOuYWVovshJ\".",
            "Unexpected extra form field named \"f-IK_bi\"."
        ],

    I have uploaded a screenshot of the error here.

    You might want to check where these fields are coming from and remove/handle them accordingly.

    I hope this helps!

    There is already a JavaScript error when loading the page:

    Uncaught TypeError: $(...).datepicker is not a function

    You can see this when you open the JavaScript console: https://www.ads-software.com/support/article/using-your-browser-to-diagnose-javascript-errors/

    If this is part of your scripts, you should correct it. It is because of this line:

    $( "#datepicker" ).datepicker();

    and the reason is that the library for the datepicker is not loaded.

    Then I also notice that the page uses a mixture of https:// and https://. Some browsers will prevent exactly that, causing them to load only parts of the page. Since you seem to have an SSL certificate, I would recommend switching any output to https://. In the simplest case, you only need to adjust the page URL in the WordPress settings and save the permalinks once. See: https://www.ads-software.com/support/article/https-for-wordpress/

    Possibly both will then also solve the problems with Safari.

    Thread Starter darrellwilde

    (@darrellwilde)

    @threadi Ok I found the datepicker script and removed it which has resolved the errors in javascript but the form still doesnt work in Safari only Chrome for some reason.

    • This reply was modified 2 years, 7 months ago by darrellwilde.
    Thread Starter darrellwilde

    (@darrellwilde)

    @kaavyaiyer Are you still getting these errors now i have removed the datepicker issue?

    I have no idea where it is getting those extra fields from as they are not embedded on my page.

    Unfortunately it still isnt working on Safari for me only chrome on desktop.

    • This reply was modified 2 years, 7 months ago by darrellwilde.
    Thread Starter darrellwilde

    (@darrellwilde)

    I have made a html page just with the javascript and form on and it works.
    See: https://www.activetalentagency.com/form_test.htm

    It just seems to be something in WordPress which is preventing it on Safari and possibly other browsers.

    I also see the errors mentioned by @kaavyaiyer and can understand the error he describes. The fields are also in the source code within your form and are added by a JavaScript that is in the HTML code of the page. Here is an excerpt of it:

    if ($(form).attr("method") != "get") { $(form).append('<input type="hidden" name="aEyFekStThd" value="BmMx5_J@70z8u" />'); }

    Your template does not contain these fields, nor does wordpress itself create them, which is why I suspect that some plugin in your system adds them. Possibly it is an anti-spam protection plugin.

    My recommendation would therefore be to deactivate all plugins and see if this changes the situation. If not, you should also change the theme as a test.

    Thread Starter darrellwilde

    (@darrellwilde)

    @threadi @kaavyaiyer Well guys that was strange…. I disabled all plugins, activated them one by one and the mysterious extra fields disappeared.

    I have no idea why… however now the form works for me on all browsers if you can test to make sure id be grateful.

    Thanks

    Darrell

    Even if it works now, the strange source code is still included in the page. If your form processing can suddenly handle it, it’s fine – but surprising.

    Thread Starter darrellwilde

    (@darrellwilde)

    @threadi yes i think some of that source code is from plugins, but as long as it works its ok.

    One thing i have noticed is that the search function of my site has stopped working im not sure whether this has been a conflict with the new form.

    The fact that the search no longer works could have something to do with this strange script. You should get an overview of which plugin is responsible for what.

    Hi @darrellwilde,

    I tested your page on both the browsers and the errors are still there and it just clears my form.
    I think the best approach for troubleshooting, like @threadi mentioned, would be to figure out which plugin is causing the extra fields to be added to your form.

    Are you using any plugin for the search feature?

    Thread Starter darrellwilde

    (@darrellwilde)

    @kaavyaiyer really? I’ve just tested on chrome safari and edge and all seem to be working for me now.

    The only thing I am using for a plug-in to do with search is a live search plugin option.

    Nothing else.

    I deactivated all plugins and the search still didn’t work for some reason.

    • This reply was modified 2 years, 7 months ago by darrellwilde.

    The search form cannot be submitted because the jQuery from https://malsup.github.io/jquery.form.js that is included via your code sets an event here that prevents the search form from being submitted.

    Thread Starter darrellwilde

    (@darrellwilde)

    @threadi even when i have removed this it still doesn’t work.

    I can still see it in the source code of the page. Therefore the search still does not work.

    My advice would be that you look for someone who can support you directly. Within the framework of the forum this becomes more and more difficult.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Jquery not working with Safari browser’ is closed to new replies.