Hide table row if input value is empty, in e-mail notification?

Home Forums Quform PHP Hide table row if input value is empty, in e-mail notification?

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  drebbin 6 days, 3 hours ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #29415

    drebbin
    Participant

    Similar to the QuForm WordPress question:
    https://support.themecatcher.net/forums/topic/hide-table-row-when-field-is-empty-in-e-mail-notification

    How can I hide a table row in emails/notification.php if certain input fields are empty? e.g. If checkbox for product01 is unchecked, the row with product01’s title, quantity and price values is hidden.

    Huge thanks in advance. 🙂

    • This topic was modified 1 week, 6 days ago by  drebbin. Reason: Link previewed webpage, and covered the question
    #29443

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #29449

    drebbin
    Participant

    Thanks Ally, this is very useful, and I’ve used the code in the emails/notification.php (see below).

    I’m trying to get the form results to display in a row for each product, not possible if I use the the code above in process.php.
    e.g. Basically a tidy way to do this…

    <table>
    <?php if ($form->getElement('product01')->isEmpty()) : ?>
    <?php else: ?>
        <tr><td>product01</td><td>title01</td><td>quantity01</td><td>price01</td></tr>
    <?php endif; ?>
    <?php if ($form->getElement('product02')->isEmpty()) : ?>
    <?php else: ?>
        <tr><td>product02</td><td>title02</td><td>quantity02</td><td>price02</td></tr>
    <?php endif; ?>
    </table>
    
    • This reply was modified 6 days, 8 hours ago by  drebbin. Reason: mistake in code
    #29455

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #29456

    drebbin
    Participant

    Awesome! Both work perfectly. Many thanks Ally.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Be inspired. © 2019 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy