• Resolved cb49747

    (@cb49747)


    I have modal window that is open with a button in that modal window I have this code.

    <?php echo do_shortcode('[yikes-mailchimp form="1"]'); ?>

    This shows the form on the modal window but there is now action. Here is the code. that is generated.

    <form id="news-letter-sign-up-1" class="yikes-easy-mc-form yikes-easy-mc-form-1  " action="" method="POST" data-attr-form-id="1">
    ...
    </form>
    <!-- MailChimp Form generated using Easy Forms for MailChimp v6.2.1 by YIKES, Inc. (https://ww.wp.xz.cn/plugins/yikes-inc-easy-mailchimp-extender/) -->

    The form will not submit to mail chimp. What am I missing?

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @cb49747,

    Our forms do not have action attributes so there must be another error that is preventing the form from submitting to MailChimp. What happens when you click submit? Are there any noticeable error messages?

    Kevin.

    Thread Starter cb49747

    (@cb49747)

    I love the plugin, great work. I got it to work by deselecting the enable json submission in the forms settings. What would need to be done to use json? Would I need to create my own json to handle the request?

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    I’m glad you enjoy the plugin!

    I am not 100% sure, but I think the issue may be that the JavaScript file that handles the submission is not being enqueued on your page. This could happen if you’re only using do_shortcode() and there are no other forms embedded onto the page.

    Do you know how to check if a JavaScript page has been loaded? If so, you could look for yikes-mc-ajax-forms.min.js. If not, you could send me a URL to your site and I will check :-).

    Cheers,
    Kevin.

    • This reply was modified 9 years, 5 months ago by yikesitskevin.
    Thread Starter cb49747

    (@cb49747)

    I don’t believe that javascript is loading.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    If you are able to, you can enqueue this file yourself. It’ll take a bit of testing to make sure it’s working, but you could enqueue it with something like this:

    global $post;
    $page_data = $post;
    if ( defined( YIKES_MC_URL ) && defined( YIKES_MC_VERSION ) && ! empty( $page_data ) ) {
    wp_enqueue_script( 'yikes-easy-mc-ajax' , YIKES_MC_URL . 'public/js/yikes-mc-ajax-forms.min.js' , array( 'jquery' ) , YIKES_MC_VERSION, false );
    wp_localize_script( 'yikes-easy-mc-ajax', 'yikes_mailchimp_ajax', array(
    				'ajax_url'                      => esc_url( admin_url( 'admin-ajax.php' ) ),
    				'page_data'                     => $page_data,
    				'interest_group_checkbox_error' => '', // Add your own error text here, e.g. "This field is required"
    				'preloader_url'                 => apply_filters( 'yikes-mailchimp-preloader', esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) ),
    				'loading_dots'                  => apply_filters( 'yikes-mailchimp-loading-dots', YIKES_MC_URL . 'includes/images/loading-dots.gif' ),
    			) );
    }

    Is that helpful?

    Thread Starter cb49747

    (@cb49747)

    ok thanks,

    I will try to give this a try a bit later

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Yeah sorry it’s a bit complicated. And I’m still not 100% sure that the missing JavaScript file is the issue; if you have a URL to your site I can check it out for you.

    Let me know,
    Kevin.

    Thread Starter cb49747

    (@cb49747)

    Sure Kevin.

    here is the site http://www.mckinleyproducts.com/wp/

    This is still underconstruction, so don’t be to critical. lol

    Appreciate it.

    Chris

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Chris,

    The form is not set to AJAX right now so I can’t tell if the JavaScript file is being loaded!

    Thread Starter cb49747

    (@cb49747)

    Shoot
    sorry I just set it to AJAX.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Chris,

    I just looked at the site again and it seemed like the form still wasn’t using AJAX. Are you sure you set the Enable AJAX Submission to yes?

    Thread Starter cb49747

    (@cb49747)

    screen shot

    I have this selected here and have clicked update form am I missing something?

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Chris,

    Can you try embedding the shortcode like this:

    [yikes-mailchimp form="1" ajax="1"]

    After reviewing the code, I don’t see a reason why your shortcode wouldn’t enqueue the required AJAX file. So you do not need to enqueue the file yourself; there must be another issue preventing the files from loading.

    • This reply was modified 9 years, 5 months ago by yikesitskevin.
    Thread Starter cb49747

    (@cb49747)

    Also appreciate all the here. You are going above and beyond.

    Thanks.

    Thread Starter cb49747

    (@cb49747)

    Yep I changed the short code.

Viewing 15 replies - 1 through 15 (of 22 total)

The topic ‘No action in form using shortcode’ is closed to new replies.