Hi,
it looks like you are mixing up client side and server side javascript.
If you want to build form elements dynamically you would use only server side javascript and html:
<%//server side javascript
//loop and create a text field on each loop
//declare the f variable and store the new field name for each loop
var f;
for (s = 1; s <= 9; s++) {
//change the name of f at each loop
f="dbh"+s+"2";
//now we are ready to build the html, lets close the server side asp tag and switch to html
%>
<p><INPUT TYPE="text" VALUE="value goes here" NAME="<% = f %>"></P>
<%
//now we are back server side and close the loop
}
//end of script
%>
This should do it, not that you should do this within the body of your page where you want to form elements to go.
Hope this helps,
Regards,