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!

increment counter

Status
Not open for further replies.

cylly

Programmer
Oct 17, 2002
23
CA
I am trying to increment a counter by one everytime my interator loops through table data.
<TABLE border=1>
<TR onclick=&quot;highlightTR '#c9cc99','cc3333',this);&quot;>
<pr:fieldIterator>
<TD><pr:field /></TD>
</pr:fieldIterator>

</TR>

I would like to increment my counter here <TD><pr:field /></TD>.

Any suggestions would be greatly appreciated.
 
Since you're looping through table data already, that means you've got the problem halfway solved. In loop you have that prints different table data with each iteration (I'm assming <pr:field> is a placeholder for that data), just define a counter variable prior to that loop with a value of 1, echo that value at each pr:fieldIterator tag, and then increment counter by one just before the iteration ends.
 
Ehhh, I misread your post a bit, but the same concept still applies.
 
Can you please give me an example? I still don't quite follow what you are saying.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top