Home › Forums › Quform PHP › Hide table row if input value is empty, in e-mail notification?
- This topic has 4 replies, 2 voices, and was last updated 5 years, 5 months ago by drebbin.
- AuthorPosts
- June 3, 2019 at 4:44 pm #29415drebbinParticipant
Similar to the QuForm WordPress question:
https://support.themecatcher.net/forums/topic/hide-table-row-when-field-is-empty-in-e-mail-notificationHow 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 5 years, 5 months ago by drebbin. Reason: Link previewed webpage, and covered the question
June 10, 2019 at 9:54 am #29443AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 10, 2019 at 11:53 am #29449drebbinParticipantThanks 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 5 years, 5 months ago by drebbin. Reason: mistake in code
June 10, 2019 at 4:30 pm #29455AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 10, 2019 at 5:04 pm #29456drebbinParticipantAwesome! Both work perfectly. Many thanks Ally.
- AuthorPosts
- You must be logged in to reply to this topic.