Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cause a div id to increment by one number when repeated in recordset

Status
Not open for further replies.

shopwise

Technical User
Sep 22, 2008
52
US
In the following code:
Code:
<%
startrw = 0
endrw = Hlooper8__index
numberColumns = 1
numrows = -1
while((numrows <> 0) AND (Not Recordset1.EOF))
	startrw = endrw + 1
	endrw = endrw + numberColumns
 %>
                  
                    <%
While ((startrw <= endrw) AND (Not Recordset1.EOF))
%>
<%
				dim myid8
myid8="billboard" & Cstr(startrw)
%>
	


<div id="<%=myid8%>" class="billcontent">
 <%= Recordset1("ShipToCompany")%> - <%= Recordset1("ShipToCity") %>, <%= Recordset1("ShipToState")%> 
</div>
		  <%
	startrw = startrw + 1
	Recordset1.MoveNext()
	Wend
	%>

                  <%
 numrows=numrows-1
 Wend
 %>
The specific line of code:
<div id="<%=myid8%>" class="billcontent">

renders as:
<div id="billboard1" class="billcontent">
the id then increments with the repeated recordset as follows:
billboard2, billboard3, billboard4 etc.

>how do i get the first record to render as:
billboard0 instead of starting with billboard1?

a script dependent on this code will not work otherwise
 
>the id then increments with the repeated recordset as follows:
>billboard2, billboard3, billboard4 etc.
But that outcomes depend, nearly by accident or coincident, on the actual value of Hlooper8__index being 0 and numberColumns being 1. The latter we can be assured by the line 1 being assigned to numberColumns, the former is nearly by accident.

But granted Hlooper7__index is actually always 0, this should do, should it not?
[tt]
<%
[red]'[/red]startrw = 0
endrw = Hlooper8__index
[red]startrw=endrw[/red]
numberColumns = 1
numrows = -1
while((numrows <> 0) AND (Not Recordset1.EOF))
[red]'[/red]startrw = endrw + 1
endrw = endrw + numberColumns
%>
[/tt]
The rest the same.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top