Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #254049

    Thomxnj
    Participant

    Is it possible to create a modal pop-up with a contact form 7 form inside? I saw somewhere in a forum post that this can be created with a lightbox, but I can not find the post.

    Thanks in advance!

    #254112

    Thai
    Moderator

    Hi There,
    Thanks for writing in.
    You can try adding this following code to the page / post content, don’t forget to switch your Content Editor to Text Mode:

    
    <div id="my-content">
      [contact-form-7 id="54" title="Contact Modal"]
    </div>
    
    <a href="#my-content" class="lightbox-selector x-btn" data-type="inline">Click Me</a>
    
    [lightbox selector=".lightbox-selector"]
    

    Hope it helps.

    #357220

    Integratutions
    Participant

    Hi,

    I managed to get it all setup. But I have some extra gap on my form’s top and bottom. Please refer to screenshot : http://tinypic.com/r/35k205i/8

    How do I get rid of those gaps/white spaces?

    Thanks in advance! 🙂

    #357221

    Integratutions
    Participant

    Hi,

    I managed to get it all setup. But I have some extra gap on my form’s top and bottom. Please refer to screenshot : http://tinypic.com/r/35k205i/8

    http://axiomlearning.sg/primary-school/

    How do I get rid of those gaps/white spaces?

    And lastly, the q from (required) and g from (Message) is slightly cut off, what’s the best way to align them properly?

    Thanks in advance! 🙂

    #357313

    Prasant Rai
    Moderator

    Hello There,

    Thanks for writing in!

    Kindly use following CSS under Custom > CSS in the Customizer:

    form.wpcf7-form {
        margin-bottom: 0 !important;
    }
    
    form.wpcf7-form h4 {
        margin-top: 0.50em !important;
    }
    
    .ilightbox-container {
        height: auto !important;
    }

    Let us know how it goes.

    Thanks.

    #357669

    Integratutions
    Participant

    Wow, thanks for the quick update. The white spaces on top and bottom have been removed. 🙂

    Just need the alignment of the input fields or the field titles to be adjusted so that the “g” and “q” aren’t cut off.
    http://tinypic.com/r/npgpcg/8

    Thanks again! 🙂

    #357772

    John Ezra
    Member

    Hi there,

    Thanks for updating the thread! You can add this under Custom > CSS in the Customizer or in your child theme’s style.css file.

    form.wpcf7-form p {
        line-height: 1.8;
    }

    Hope this helps – thanks!

    #358078

    Integratutions
    Participant

    Yeah. It’s all great now! 🙂

    #358099

    Paul R
    Moderator

    Good to know.

    Have a great day! 🙂

    #723376

    cooper2121
    Participant

    How would I put this code :

    <div id="my-content">
      [contact-form-7 id="54" title="Contact Modal"]
    </div>
    
    <a href="#my-content" class="lightbox-selector x-btn" data-type="inline">Click Me</a>
    
    [lightbox selector=".lightbox-selector"]

    Into my theme with cornerstone?

    #723589

    Lely
    Moderator

    Hello There,

    Using Cornerstone, please add a RAW CONTENT element and then enter above code.

    Hope this helps.

    #837057

    niqujagga
    Participant

    Hello

    Is it possible, to link a ligthbox not to a button but to an usual link? I imagine a normal textblock and in this text, i link a word to a lightbox containing a form.

    #837131

    Thai
    Moderator

    Hi There,

    Please update the previous code a bit:

    <div id="my-content">
      [contact-form-7 id="177" title="Contact form 1"]
    </div>
    
    Hello, click <a href="#my-content" class="lightbox-selector">me</a> to show the lightbox!
    
    [lightbox selector=".lightbox-selector"]

    Hope it helps 🙂

    #871610

    chelseakleinsasser
    Participant

    Hello,
    I added the code from above:
    <div id=”my-content”>
    [contact-form-7 id=”54″ title=”Contact Modal”]
    </div>

    Click Me

    [lightbox selector=”.lightbox-selector”]

    But it showed up with the contact form showing, with a button underneath. The button works to open up the lightbox, but I would like the form hidden until you click the button.
    Here is a screenshot of my form.

    #872381

    Lely
    Moderator

    Hi There,

    Please try updating the code to this:

    <div id="my-content" style="display:none;">
    [contact-form-7 id="54" title="Contact Modal"]
    </div>

    Hope this helps.