Alfredomulet
MIS
Hello there, I need your help before I
...
A part of my result table should show 1, 2, 3 .. rows (never more than 10) depending on the value entered by the user through a form.
The output must be, if the user enters 4:
some info
1º Item
2º Item
3º Item
4º Item
other info
The code I have now looks like:
The issue is that with this code my page seem to enter in a neverending bucle, killing all the resources on my machine, like if it never finds the form_nritems value. But,
, if I do:
it works perfect and brings the results in a second!!! But of course, reverse way, which doesn't work for my users... What am I doing wrong with the first code??? Any ideas, workarounds???
(I've also tried:
i= form_nritems
x= 1
do while x < i with no luck....)
thanks!
Alfredo
![[pc] [pc] [pc]](/data/assets/smilies/pc.gif)
A part of my result table should show 1, 2, 3 .. rows (never more than 10) depending on the value entered by the user through a form.
The output must be, if the user enters 4:
some info
1º Item
2º Item
3º Item
4º Item
other info
The code I have now looks like:
Code:
<% form_nritems=request.form("nritems") %>
<% i= 1
do until i = form_nritems
'also tried with do while i < form_nritems
%>
<tr>
<td><%= i%>º Item</td>
</tr>
<% i = i + 1
loop
%>
The issue is that with this code my page seem to enter in a neverending bucle, killing all the resources on my machine, like if it never finds the form_nritems value. But,
![[curse] [curse] [curse]](/data/assets/smilies/curse.gif)
Code:
<% form_nritems=request.form("nritems") %>
<%
i= form_nritems
do until i = 0
%>
<tr>
<td><%= i%>º Item</td>
</tr>
<% i = i - 1
loop
%>
it works perfect and brings the results in a second!!! But of course, reverse way, which doesn't work for my users... What am I doing wrong with the first code??? Any ideas, workarounds???
(I've also tried:
i= form_nritems
x= 1
do while x < i with no luck....)
thanks!
Alfredo