WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] Using Fancybox with Contact Form 7 (9 posts)

  1. jamesisfishing
    Member
    Posted 3 years ago #

    I am loading a simple contact form in a modal fancybox container. It has two required fields, name and email. I want the fancybox to close after the form has successfully validated those fields. Does anyone know how to do this?

    http://wordpress.org/extend/plugins/contact-form-7/

  2. jamesisfishing
    Member
    Posted 3 years ago #

    Found a really simple solution for this if anyone interested.
    Added on_sent_ok: $.fancybox.close(); in the Contact Form 7 additional settings. Excellent.

  3. Coerv
    Member
    Posted 3 years ago #

    Hey,

    I wonder how you got the validation-stuff loading into the fancybox-window. Whenever I hit the Send-Button it gives me this:

    The requested content cannot be loaded. Please try again later.

    I couldn't find a solution for that, but replacing fancybox with something else. But I've got it working for a bunch of other things on the website, except for the contactform, so I wouldn't like to switch.

    Do you have a tip for me, what I'm doing wrong?
    If it helps, here is the link: http://www.crocfiles.de/
    You must click on "Contact" in the bottom-left corner.

  4. jamesisfishing
    Member
    Posted 3 years ago #

    Hey there,

    My first question would be, is the form actually working independently of the the fancybox window?

    ie, if you place the form on its own page, does the validation work and can you submit the form details successfully?

    You also have the shortcode for what appears to be another form in that same area. What is that doing there?

    If you can put a page up with a form that works, let me know and I'll have a look at fancybox stuff.

    I actually created a separate page template for the fancybox window that contains the form and opens in fancybox window when clicked.

    J

  5. Coerv
    Member
    Posted 3 years ago #

    Thanxalot for responding.

    Yes, the contactform 7 plugin works just fine without the fancybox. Here is the link to the contactform without fancybox: http://www.crocfiles.de/contact/

    The shortcode on the homepage is my second problem. I want to display a small contactform in that box, for sending quick messages. I thought I could do that by calling the content of the contact page with:<?php $pageID = 9; $page = get_post($pageID); echo $page->post_content; ?> But as you can see it just gives me that shortcode thingy. If you could give me a hint on that, too, that would be brilliant.

    So what you did was, instead of using the standard page.php, creating another template especially for the contactform? Did you add special code to make the plugin work inside of fancybox?

  6. jamesisfishing
    Member
    Posted 3 years ago #

    Hi.
    You seem to have changed your homepage and removed the other form. You also now seem to be just trying to display the validation messages in the fancybox window? Is that what you are trying to do? Display errors or success msg in the fancybox window, not that contact form anymore?

  7. Coerv
    Member
    Posted 3 years ago #

    I managed to integrate the small contactform in the bottom-right box and when you hit "send", the validation messages are supposed to appear in the fancybox window.

    But the other contact form in the fancybox window is still there. It opens, when you press the headline "Contact".

  8. jamesisfishing
    Member
    Posted 3 years ago #

    This is now a bit different to what i achieved. You are now trying to load just the validation message in the fancybox, not the entire form. If i could see what you have in your site might help, send me your email to discuss further if you like.

  9. Coerv
    Member
    Posted 3 years ago #

    Hey,

    sorry for not responding the last 2 weeks. I took some vacation.

    I also got the problem solved. It was as easy as giving the class-name "iframe" to the link.

    Thank you for the help.
    gCoerv

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic