Question: Simple question. Is it possible to replace the following code:

```
document.form_name.element_name

```

with

```
document.form_name.<array[index].value>

```

?

Answer: 
Try this:

```
document.form_name[array[index].value];

```
```
var my_element = "username";
document.form_name[my_element];

```

and

```
var fields = [ "username", "realname" ];
document.form_name[fields[0]];

```