Populate textfields with ascending numbers

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Populate textfields with ascending numbers

Post by Sindarin »

I retrieve results from a database in a table.
Image

Left of the results is a textfield that accepts a number. I want to create a button that populates those textfields with a number starting from 0 ascending +1. So fields of 5 results will be populated as:
0
1
2
3
4
5

Any help? Thanks,
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Populate textfields with ascending numbers

Post by VladSun »

Put all of these text inputs in a block element (e.g. DIV or TABLE) and iterate them by using getElementsByTagName :)
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply