Page 1 of 1

Populate textfields with ascending numbers

Posted: Mon Apr 13, 2009 6:44 pm
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,

Re: Populate textfields with ascending numbers

Posted: Tue Apr 14, 2009 3:13 am
by VladSun
Put all of these text inputs in a block element (e.g. DIV or TABLE) and iterate them by using getElementsByTagName :)