WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Clone div on page to email message (3 posts)

  1. darkknight187
    Member
    Posted 6 months ago #

    I have been trying just about everything here.
    Basically when the user gets to this page they have the contact form 7, and the results of a planner showing on page.

    What I would like to do is simply clone my div on page to the the email body.

    Sounds so easy.

    Very easy to use jQuery to clone to the form itself

    <div id"test2"></div>
    jQuery('#direct-mail-answer').clone('#direct-mail-answer').appendTo('#test2');

    But I just can't seem to get the div into the email body.
    The only things that seem to come across are inputs by name=*

    How can I get custom elements on page into the email message?

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

  2. darkknight187
    Member
    Posted 6 months ago #

    Has any one been able to carry over html into the email?
    I'm thinking some function right before email sent.
    I tried a function in the addition settings on_sent_ok: "cloneresults();"

    And the function was the above jQuery.

    Tried pasting jQuery directly into additional settings.

    There's got to be a way around it.

    Any thoughts???

    Thank you in advance.

  3. acub
    Member
    Posted 6 months ago #

    I think I know why your jQuery doesn't work. Had a similar problem here.

    You need to enqueue your script in the footer, to the jquery array, so the wpcf7 scripts are loaded when yours get executed.

Reply

You must log in to post.

About this Plugin

About this Topic