//pass the parameter (searchword) from stateless form (Aistear_Links)
//fetch the record from "Aistear" form (Aistear), fields = Category, Learning_Goal
htmlpage Search(searchword)
<%{
word = Aistear[Learning_Goal == input.searchword];
message = "";
if (word.count()>0)
{
for each x in word.Learning_Goal
message = "message + x.Learning_Goal
}%>
<table>
<tr>
<td width="222px" valign="top">
<div elName='zc-component' formLinkName='Aistear_Links' params='zc_FtrClr=_ffffff&zc_InpFieldWidth=100&zc_Header=false'>Please Wait...</div>
</td>
<td>
<table class="zc-viewtable" style="border:0px solid #75b5f2">
<tr>
<th>Search Results</th>
</tr>
<tr class="zc-row-header">
<th class="zc-viewrowheader">
Category
</th>
<th class="zc-viewrowheader">
Learning Goal
</th>
</tr>
<tr class="zc-viewrow zc-row-1">
<td><%=word.Category%></a></td>
<td><%=message%></a></td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
</table>
</td>
</tr>
</table>
//display error if no records found
<div style="text-align: center;"> </div> <%}
else if ((input.searchword != null) && (input.searchword.length() > 0))
{%>
<h2>Name Not Present</h2>
<%}
}%>
The code returns a 'null' error.
Where am I going wrong?