If statement in Loop (in my HTML view)

If statement in Loop (in my HTML view)

Hello,

Can someone help me with the following code, it is inside my HTML view - there is a lot of code so I will just post the code I think is causing the problem. I am just getting the error "null" when I press Save Script.

  1. <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
  2.     <thead>
  3.         <tr>

  4.             <th scope="col"><span style="color:#a9a9a9;font-size:8px;"><b>ITEM</b></th>
  5.             <th scope="col"><span style="color:#a9a9a9;font-size:8px;"><b>DRAWING NO.</b></th>
  6.             <th scope="col"><span style="color:#a9a9a9;font-size:8px;"><b>ISSUE NO.</b></th>
  7.             <th scope="col"><span style="color:#a9a9a9;font-size:8px;"><b>DESCRIPTION</b></th>
  8.             <th scope="col"><span style="color:#a9a9a9;font-size:8px;"><b>QUANTITY</b></th>
  9.             <th scope="col"><span style="color:#a9a9a9;font-size:8px;"><b>UNIT PRICE</b></th>

  10.         </tr>
  11.     </thead>
  12.     <tbody align="center">

  13. <%for each DRW in Quote.Add_drawings_to_quote
  14.     {%>
  15.         <tr>

  16.         <td><%=Item%></td>
  17.         <td><%=DRW.Drawing_no%></td>
  18.         <td><%=DRW.Issue_no%></td>
  19.         <td><%=DRW.Description%></td>
  20.         <td><%=DRW.Quantity%></td>
  21.         <td>£<%=DRW.Quote_price%></td>

  22.         </tr>

  23.       <%if (DRW.Notes == "")
  24.         {
  25.             Item = (Item  +  1);
  26.         }
  27.         else
  28.         {%>
  29.            <tr><td><%=Quote.Notes%></td></tr>
  30.         <%}

  31.     }%>


  32.     </tbody>
  33.   </table>

Basically I want to check if the variable DRW.Notes has anything stored in it, and if it does I want to add a row to my HTML table and show the contents, if it doesn't have anything on it carry on with the "For loop"

I hope this makes some sense - please ask if you need more information.

Many thanks
Ben