• 0
David1010

Hide field that aren't filled out in acknowledgment email

Question

I wrote this simple code which takes in parameters from the database Caspio to create a simple table. I just want this table to remove all fields which are empty. Since email servers do not run javascript, what is the best way to hide the rows which are empty (the paramters such as @field:Facility is not filled out). Thanks!

I've also added the code: 

 

<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <style type="text/css">
      tr:nth-child(even) {
        background-color: #D3D3D3
      }
      

    </style>
  </head>

  <body>
    <table class="Form" border="5" width="95%" cellpadding="10">
      <thead>
        <tr>
          <th colspan="2">&nbsp;
            <h3>[@field:TestOrder] - [@field:Facility]</h3>
          </th>
        </tr>
      </thead>
      <colgroup>
        <col width="250" />
        <col width="750" /> </colgroup>
      <tbody>
        <tr>
          <th>FIELD</th>
          <th>RESPONSE</th>
        </tr>
        <tr align="LEFT">
          <td>Facility :</td>
          <td>[@field:Facility]</td>
        </tr>
        <tr align="LEFT">
          <td>Patient ID :</td>
          <td>[@field:PatientID]</td>
        </tr>
        <tr align="LEFT">
          <td>First Name :</td>
          <td>[@field:PatientFirst]</td>
        </tr>
        <tr align="LEFT">
          <td>Last Name :</td>
          <td>&nbsp;</td>
        </tr>
        <tr align="LEFT">
          <td>Date of Birth:</td>
          <td>[@field:DateOfBirth]</td>
        </tr>
        <tr align="LEFT">
          <td>Gender :</td>
          <td>&nbsp;</td>
        </tr>
        <tr align="LEFT">
          <td>Primary Phone :</td>
          <td>[@field:PrimaryPhone]</td>
        </tr>
        <tr align="LEFT">
          <td>Secondary Phone :</td>
          <td>[@field:SecondaryPhone]</td>
        </tr>
        <tr align="LEFT">
          <td>Emergency Contact :</td>
          <td>[@field:EmergencyContact]</td>
        </tr>
        <tr align="LEFT">
          <td>Emergency Number :</td>
          <td>[@field:EmergencyNumber]</td>
        </tr>
        <tr align="LEFT">
          <td>Patient Address :</td>
          <td>[@field:PatientAddress]</td>
        </tr>
        <tr align="LEFT">
          <td>City :</td>
          <td>[@field:City]</td>
        </tr>
        <tr align="LEFT">
          <td>State :</td>
          <td>[@field:State ]</td>
        </tr>
        <tr align="LEFT">
          <td>Zip Code :</td>
          <td>[@field:ZipCode]</td>
        </tr>
        <tr align="LEFT">
          <td>Special Instructions :</td>
          <td>[@field:SpecialInstructions]</td>
        </tr>
        <tr align="LEFT">
          <td>Primary Insurance :</td>
          <td>[@field:PrimaryInsurance]</td>
        </tr>
        <tr align="LEFT">
          <td>Primary Subscriber ID :</td>
          <td>[@field:PrimarySubscriberID]</td>
        </tr>
        <tr align="LEFT">
          <td>Primary Subscriber Relationship :</td>
          <td>[@field:PrmarySubscriberRelationship]</td>
        </tr>
        <tr align="LEFT">
          <td>Secondary Insurance :</td>
          <td>[@field:SecondaryInsurance ]</td>
        </tr>
        <tr align="LEFT">
          <td>Secondary Insurance ID :</td>
          <td>[@field:SecondaryInsuranceID ]</td>
        </tr>
        <tr align="LEFT">
          <td>Secondary Subscriber Relationship :</td>
          <td>[@field:SecondarySubscriberRelationship ]</td>
        </tr>
        <tr align="LEFT">
          <td>Diagnosis :</td>
          <td>[@field:Diagnosis]</td>
        </tr>
        <tr align="LEFT">
          <td>Other Diagnosis :</td>
          <td>[@field:OtherDiagnosis]</td>
        </tr>
        <tr align="LEFT">
          <td>Physician Name :</td>
          <td>[@field:PhysicianName ]</td>
        </tr>
        <tr align="LEFT">
          <td>Other Physician :</td>
          <td>[@field:OtherPhysician]</td>
        </tr>
        <tr align="LEFT">
          <td>Physician Phone :</td>
          <td>[@field:PhysicianPhone]</td>
        </tr>
        <tr align="LEFT">
          <td>Physician Fax :</td>
          <td>[@field:PhysicianFax]</td>
        </tr>
        <tr align="LEFT">
          <td>After Hours Phone :</td>
          <td>[@field:AfterHoursPhone]</td>
        </tr>
        <tr align="LEFT">
          <td>Test Order :</td>
          <td>[@field:TestOrder]</td>
        </tr>
        <tr align="LEFT">
          <td>Test Duration :</td>
          <td>[@field:TestDuration]</td>
        </tr>
        <tr align="LEFT">
          <td>Holter Performed :</td>
          <td>[@field:HolterPerformed]</td>
        </tr>
        <tr align="LEFT">
          <td>Holter Test Order :</td>
          <td>[@field:HolterTestOrder]</td>
        </tr>
        <tr align="LEFT">
          <td>Holter Duration :</td>
          <td>[@field:HolterDuration]</td>
        </tr>
        <tr align="LEFT">
          <td>Previous Holter Date :</td>
          <td>[@field:PreviousHolterDate]</td>
        </tr>
        <tr align="LEFT">
          <td>Requested Start Date :</td>
          <td>[@field:RequestedStartDate]</td>
        </tr>
        <tr align="LEFT">
          <td>Receive Monitor :</td>
          <td>[@field:ReceiveMonitor]</td>
        </tr>
        <tr align="LEFT">
          <td>Recorder ID Number :</td>
          <td>[@field:RecorderIDNumber ]</td>
        </tr>
        <tr align="LEFT">
          <td>H_P :</td>
          <td>[@field:H_P]</td>
        </tr>
        <tr align="LEFT">
          <td>Upload HP :</td>
          <td>[@field:UpploadHP]</td>
        </tr>
        <tr align="LEFT">
          <td>Authorize :</td>
          <td>[@field:Authorize]</td>
        </tr>
        <tr align="LEFT">
          <td>Submit :</td>
          <td>&nbsp;</td>
        </tr>
      </tbody>
    </table>
  </body>

</html>
 

Share this post


Link to post
Share on other sites

1 answer to this question

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now