• Hi,

    I wish to know if I can customise the popup for individual contact form? Currently, the form is applied to all forms. Possible to set a different popup(with different content) for each form?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    I made a quick small change to the javascript from the plugin, so that it will use the default success message (which can be set in WCF7 settings) for each individual form. In this way, the feedback message can be different for each of the forms from the site. It’s not a very elegant solution, but it works.

    <script>
    
    var appendthis =  ("<div class='modal-overlay js-modal-close'></div>");
    
    var popHtml = '<div id="popup" style="width:{$popup_width}; height: {$popup_height}; background: {$popup_background} url({$background_img}) no-repeat right top; background-size:cover; color: {$popup_font_color} !important; " class="modal-box"><header><a href="#" class="js-modal-close close">×</a><h3>{$popup_title} </h3></header><div class="modal-body"><p id="pop-up-description"></p></div><footer> {$footer_text} </footer></div>';
    jQuery("body").append(popHtml);	
    
    	jQuery(".wpcf7-submit").click(function(event) {
    		jQuery( document ).ajaxComplete(function(event, xhr, settings) {
    		var data=xhr.responseText;
    		var jsonResponse = JSON.parse(data);
    		jQuery('#pop-up-description').html(jsonResponse['message']);
    		if(jsonResponse["mailSent"] === true)
    		{
    		    event.preventDefault();
    		    jQuery("body").append(appendthis);
    		    jQuery(".modal-overlay").fadeTo(500, 0.7);
    		    jQuery('#popup').fadeIn("popup");
    		    jQuery(".wpcf7-response-output").css( "display", "none" ); 
    			setTimeout(function(){
    				jQuery( ".js-modal-close" ).trigger( "click" );
    			}, {$popup_duration});
    		}
    	});
    	});
    	</script>
    • This reply was modified 7 years, 11 months ago by tibi.buzdugan.

    It only works for the message of success.
    Would you like to present popup for all messages, including error messages?

    That might be a useful feature, but it wasn’t a must in the project I used the popup confirmation message, because the errors looked nicely inline with the form.

    Hi,
    Can you help me to add different Thank you message popup for multiple forms?
    Thank you in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Customise for individual forms’ is closed to new replies.