Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi @nvhcuong,

    Sorry but right now this is a little hard to do. You could grab the form response element (in JavaScript, after loading the page) and move it in the HTML document to where you want it to be.

    We’re planning on making this a whole lot easier so you can simply grab the form response message using a simple template function, but it’ll be a few weeks before we get to incorporate that into the plugin.

    Do you have a link to your site with a form on it and an example of an alert box? I can set you up with the exact JavaScript snippet that’s needed to move the response element. ??

    Let me know please!

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hi there,

    In the last update of MailChimp for WordPress we included the following function which gets the HTML for the response message in a PHP variable.

    $response = mc4wp_form_get_response_html();
    echo $response;

    This allows you to show the form response anywhere you want. You can show it inside your alert box and then show the box if the following function returns true.

    $submitted = mc4wp_form_is_submitted();
    if( $submitted ) {
       // print JS to show box
       echo '<script>openAlertBox();</script>';
    }

    Does that help? ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show response message in alert box’ is closed to new replies.