[thelist] Need name for use in Dyanically generated field name in ASP

Michele Foster foster.michele at gmail.com
Tue Feb 26 10:45:59 CST 2008

Hi all,

I'm building an online registration system, that creates the form field's
name, id and value dynamically.  Such as...

<input type=""radio"" name=""WorkshopGroupID" & WorkshopGroupingID & """
id=""WorkshopID-" & WorkshopID & """ value=""" & WorkshopID & """/>"

The form is self-processing and errors are checked server-side before final

I have found this code, which will allow me to determine the variable name
and value.

 For Each Field in Request.Form
  TheString = Field & "=Request.Form(""" & Field & """)"

The problem arises when the user hasn't filled out all of the information,
resulting in the form being rewritten to the screen, ideally with the values
they entered already pre-filled.

However, for the dynamically generated fields, I can't seem to get ASP to
let me use the field name dynamically in an If statement so that I can
indicate if the field was checked or not. i.e.

If WorkshopGroupID & WorkshopGroupingID = WorkshopID response.write "

So, I need to build a string of the field name to use in the IF statement,
but am stuck on how to do this.

Any help greatly appreciated.


Michele Foster
Work - http://wizardev.ca/
Play - http://mishka.ca/
Fun - http://isitbeertimeyet.ca/
Passion - http://quiltinggallery.com

More information about the thelist mailing list