Forums
This topic is locked
if statement in repeat region
Posted 21 Sep 2005 00:12:24
1
has voted
21 Sep 2005 00:12:24 Matthijs de Groot posted:
What do I wrong:<pre id=code><font face=courier size=2 id=code>
<%
While ((Repeat2__numRows <> 0) AND (NOT rs_formitem.EOF))
%>
<tr>
<td><%=(rs_formitem.Fields.Item("name".Value)%> - <%=(rs_formitem.Fields.Item("formid1".Value)%></td>
<td><% if (rs_formitem.Fields.Item("type".Value) = "textfield" then %>
<input name="<%=(rs_formitem.Fields.Item("elementname".Value)%>" type="textfield">
<% else if (rs_formitem.Fields.Item("type".Value) = "textbox" then %>
<textarea name="<%=(rs_formitem.Fields.Item("elementname".Value)%>"></textarea><% end if %>
</td>
</tr>
<br>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
rs_formitem.MoveNext()
Wend
%>
</font id=code></pre id=code>
I receive the following error:
<pre id=code><font face=courier size=2 id=code>
Microsoft VBScript compilation error '800a0400'
Expected statement
/file.asp, line 259
Wend
^
</font id=code></pre id=code>
Hope anyone can help me
Replies
Replied 21 Sep 2005 00:33:49
21 Sep 2005 00:33:49 Matthijs de Groot replied:
Found the solution...
<pre id=code><font face=courier size=2 id=code> <%
While ((Repeat2__numRows <> 0) AND (NOT rs_formitem.EOF))
%>
<tr>
<td><%=(rs_formitem.Fields.Item("name".Value)%> - <%=(rs_formitem.Fields.Item("formid1".Value)%></td>
<% Dim tipe
tipe = rs_formitem.Fields.Item("type".Value
if tipe = "textfield" then %>
<td><input name="<%=(rs_formitem.Fields.Item("elementname".Value)%>" type="textfield"></td>
<% else if tipe = "textbox" then %>
<td><textarea name="<%=(rs_formitem.Fields.Item("elementname".Value)%>"></textarea></td><% end if %>
<% end if%>
</tr>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
rs_formitem.MoveNext()
Wend
%></font id=code></pre id=code>
<pre id=code><font face=courier size=2 id=code> <%
While ((Repeat2__numRows <> 0) AND (NOT rs_formitem.EOF))
%>
<tr>
<td><%=(rs_formitem.Fields.Item("name".Value)%> - <%=(rs_formitem.Fields.Item("formid1".Value)%></td>
<% Dim tipe
tipe = rs_formitem.Fields.Item("type".Value
if tipe = "textfield" then %>
<td><input name="<%=(rs_formitem.Fields.Item("elementname".Value)%>" type="textfield"></td>
<% else if tipe = "textbox" then %>
<td><textarea name="<%=(rs_formitem.Fields.Item("elementname".Value)%>"></textarea></td><% end if %>
<% end if%>
</tr>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
rs_formitem.MoveNext()
Wend
%></font id=code></pre id=code>