Home Forums Plugin Support WP User Frontend Pro Submit button displays a Javascript alert: "undefined"

This topic is: resolved

This topic contains 10 replies, has 3 voices, and was last updated by  ladantre21 5 years, 9 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #5698

    spark
    Participant
    Post count: 7

    I cannot figure this out. I have a form on my website that will create a pending post. When you hit the submit button, there is a Javascript alert that only reads “undefined”.

    http://www.mejditours.com/open-tour-questionnaire/

    Which is crazy because I tested this form out last week and it worked great. I can't remember what has changed since then, was there a plugin update this past week?

    I'm pretty sure this is happening on line 128 of frontend-form.js, if that helps. I added one line here in this else clause:
    console.log(res);

    It returns -1 in the console log.

    I have tried making some other changes to figure what is causing the undefined error. I was trying to add reCaptcha to another contact form last week, which I discovered interferes with the one that FrontEnd Pro uses. Or for that matter, you can only have one reCaptcha field on any page. I have removed all the other reCaptcha stuff I added to the contact form and calls to the recaptcha files (from my functions.php) so that the only reCaptcha would be the one that FrontEnd Pro uses. It still returned undefined. I then removed the reCaptcha from the FrontEnd Pro form and it still returns undefined. So now I don't think the reCaptcha is the issue and I cannot figure out what is causing it.

    EDIT: I should also mention that I tried making a new form altogether, but it still doesn't work.

    #5701

    spark
    Participant
    Post count: 7

    I have discovered the source of the problem. I am using a plugin called Better WP Security. It has a setting to force the use of https on the login and admin areas; it's the admin area that's causing the problem. I think when the form makes the AJAX request to an https address (I noticed this in the console) it can't get a response. When I disable the https-forcing the form works fine.

    Do you think there is a solution to this? I'd still like to force https on the admin area if possible.

    #5710

    Tareq Hasan
    Keymaster
    Post count: 2831

    Hmm, thats a different problem. But as I'm using admin_url( 'admin-ajax.php' ) to determine the the ajax endpoint and it should've obey the URL scheme. You might try this:
    1. Open wpuf.php and see line 180, it's looks this 'ajaxurl' => admin_url( 'admin-ajax.php' ),
    2. Pass an additional parameter https, like this 'ajaxurl' => admin_url( 'admin-ajax.php', 'https' ),

    Now it should follow the https URL scheme.

    #5822

    spark
    Participant
    Post count: 7

    Dang, that didn't seem to help ๐Ÿ™

    I can still force https on the login, so they'll still be using https in the dashboard area. I guess they could manually change the URL after that, but I don't think the client will know enough about that sort of thing for it to be a worry ๐Ÿ˜›

    I assume the problem lies with the security plugin and how it rewrites URLs, not with WP Frontend. Oh well, if I run into problems I'll have to figure something out with that. Thanks anyway!

    #5856

    Tareq Hasan
    Keymaster
    Post count: 2831

    Right, the plugin might doing something with the URL structure. Other than that, it should work.

    #7143

    ladantre21
    Participant
    Post count: 5

    I am having the same original problem. All my forms now have a popup that displays “undefined” and won't actually submit the info. And I don't have the ‘Better WP Security' plugin. I don't know what to do.

    #7144

    ladantre21
    Participant
    Post count: 5

    One more tid bit, is that it's happening on a Single WordPress Installation. My multi-site Installation is working fine. Not sure if that makes any difference.

    #7152

    Tareq Hasan
    Keymaster
    Post count: 2831

    Can you post your site address and login details in a private reply?

    #7156

    ladantre21
    Participant
    Post count: 5
    This reply has been marked as private.
    #7164

    Tareq Hasan
    Keymaster
    Post count: 2831

    Some plugin is conflicting in your case. The plugin uses ajax for form submission and file upload and seems like no request is being reached to the server. Some plugin is blocking the ajax request, but I can't see which one. Disabling one by one may help to detect the problem.

    #7169

    ladantre21
    Participant
    Post count: 5

    It's stupid Jetpack. I'm deactivating it for good.

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Submit button displays a Javascript alert: "undefined"’ is closed to new replies.