• Resolved cmerrick

    (@cmerrick)


    Hi, I’m using this plugin on a client site. When I set the form so it reload the page on submission, it works fine (except that it reloads at the page top so depending on the page it’s hard to tell what happened). Anyway, if I try to use the ajax option, when I click the submit button it get a little twirly icon for a moment as if it’s doing something, but then nothing happens. I don’t get added to the list, I don’t get a success or error message. Toggling that one “No page refresh” checkbox seems to be the entire difference.

    When I load the page the Chrome Inspector console shows no errors and when I submit the form there’s no Console errors and Network lists admin-ajax.php with a code of 200, type xhr, initiator jquery.min.js, and the waterfall is all green.

    Please advise, thank you for your time.

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter cmerrick

    (@cmerrick)

    Hi, I’m wondering if there’s any idea when a fix for the + in email addresses issue might be available. My client would like to launch by the end of the year but if that issue isn’t resolved yet I’ll have to find another solution. Thanks.

    Plugin Author Constant Contact

    (@constantcontact)

    Hi @cmerrick

    How comfortable would you maybe be in making your own code edits for the plugin? Asking because I can provide the file, lines, and changes to make to get this handled now, while we still work up the rest to the next release. We’re planning for it to be in 1.14.0 and we don’t have any releases planned before that one.

    Thread Starter cmerrick

    (@cmerrick)

    I’m fairly comfortable working in PHP (much less so in Javascript).

    As long as it’s not going to just get overwritten in the next autoupdate in a way that reintroduces the same bug, I’m willing to try this.

    Plugin Author Constant Contact

    (@constantcontact)

    We don’t have any auto-updates planned/scheduled/etc either, so you should be fine.

    In this file: includes/class-process-form.php

    Around line 91 to 92 is

    if ( isset( $exp_fields[0] ) && $exp_fields[0] ) {
    $value     = urldecode( isset( $exp_fields[1] ) ? $exp_fields[1] : '' );
    

    We would want to change the $value = ... line to the following:

    if ( false !== strpos( $exp_fields[0], 'email__' ) ) {
    	$value = ( is_email( $exp_fields[1] ) ) ? $exp_fields[1] : '';
    } else {
    	$value = isset( $exp_fields[1] ) ? urldecode( $exp_fields[1] ) : '';
    }
    

    You can see the changes in practice over at https://github.com/WebDevStudios/constant-contact-forms/commit/139015c9154de8960af1efb9c0574aa9f2cc1d05

    Thread Starter cmerrick

    (@cmerrick)

    Many thanks! I just made this change and I’m now able to subscribe with or without a + in the email address.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Ajax submission does not work’ is closed to new replies.