# Fill textfields with a for loop

**URL:** <https://forum.kirupa.com/t/fill-textfields-with-a-for-loop/181937>\
**Category:** Uncategorized\
**Created:** [March 14, 2006, 12:37pm UTC](https://forum.kirupa.com/t/fill-textfields-with-a-for-loop/181937 "2006-03-14T12:37:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MZA](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@MZA](https://forum.kirupa.com/u/MZA)\
**Post date:** [March 14, 2006, 12:37pm UTC](https://forum.kirupa.com/t/fill-textfields-with-a-for-loop/181937/1 "2006-03-14T12:37:42Z")

</div>

Hello.  
If i have ten textfields named field\_1 to field\_10 and i want to fill them with a for loop, how do i refer to each instance name?  
Obviously the problem lays in “field\_i.text” in the following code:

```auto
for (var i=0; i<10 i++) {

field_i.text= i;
			
}

```

I just dont know how to refer to the instance name correctly using the i.  
I bet its simple but its hard to find, any guru here can help me out?

Regards
