If that code were inside a <c:forEach> element then you could get a counter out of that element. But I'm guessing it's not. In which case you could write a custom tag which returned the next sequential number every time it was called.
You are correct, it's a data entry form with a variety of HTML input types. Your idea of a custom tag is a learning curve for me, so for the time being if that is the only sciptlet code I have left in a data entry form I can live with that. I still have other form elements to deal with. I'm trying to upgrade my Tomcat 3 framework (jsp/servlet templates).
Thank you for your idea.
posted 8 years ago
The hard question I have for you is: If you didn't assign any tab indexes to any form elements, wouldn't the default sequence correspond to their order in the document? And since you're generating and numbering them in that order, why do you need to number them at all?