WordPress.org

Forums

Contact Form 7 hide empty fields and parent elements (2 posts)

  1. Jacob Roman
    Member
    Posted 1 year ago #

    Hello,

    I am using contact form 7 and have a long form with lots of text fields. I am looking for a way to only show fields that the user fills out in the email. I came across this link:

    http://wordpress.org/support/topic/plugin-contact-form-7-how-to-do-away-with-blank-lines-in-email-for-unfilled-form-items

    But it does not quite work for me because I have my email body set up like this:

    <table>
    <tr style="border:1px solid;">
    <th style="background:#000; color:#fff;">Item</th>
    <th style="background:#000; color:#fff;">Qty</th>
    </tr>
    <tr style="border:1px solid #ccc;">
    <td>Aerobic Culture Swab</td>
    <td>[AerobicCultureSwab]</td>
    </tr>
    <tr style="border:1px solid #ccc;">
    <td>Alcohol Prep Pad</td>
    <td>[AlcoholPrepPad]</td>
    <tr style="border:1px solid;">
    <tr>

    So i need the parent tr to hide if the field is empty. Any suggestions?

  2. lridgecooke
    Member
    Posted 1 year ago #

    Hi Jacob,

    Did you find an answer to your problem? I am now facing the same issue.

    Cheers Leon

Topic Closed

This topic has been closed to new replies.

About this Topic