Espero te sirva de algo. Saludos. :) ;) :P
<html>
<body bgcolor="#FFFFFF" text="#000000">
<script language="Vbscript">
Function campos()
For Each elemento in document.form1.elements
alert(elemento.name)
Next
End Function
</script>
<form name="form1" method="post" action="pagina.asp">
<input type="text" name="textfield">
<input type="text" name="textfield2">
<input type="text" name="textfield3">
<input type="text" name="textfield4">
<input type="text" name="textfield5">
<input type="text" name="textfield6">
<input type="text" name="textfield7">
<input type="text" name="textfield8">
<input type="text" name="textfield9">
<input type="text" name="textfield10">
<input type="text" name="textfield11">
<input type="text" name="textfield12">
<input type="text" name="textfield13">
<input type="text" name="textfield14">
<input type="text" name="textfield15">
<input type="text" name="textfield16">
<input type="text" name="textfield17">
<input type="text" name="textfield18">
</form>
<input type="button" value="Campos" onClick="vbscript
:campos()">
</body>
</html>
y si me puedes ayudar con mi mensaje, agradecido.