Multiple (sets) of objects on a form

Results 1 to 3 of 3

Thread: Multiple (sets) of objects on a form

  1. #1
    Kevin Hansen Guest

    Default Multiple (sets) of objects on a form

    I have created a form with about 12 objects on it. Two text areas, 3 combo boxes and about 6-7 text boxes. The user could possibly have many sets of these object to fill out. Every field on this form is mandatory, or can not be blank or null. I am having a very difficult time figuring out how to validate a form that has to be created without actually knowing how many set of objects the user will need, and how to submit the information to the database and allow the user to edit this information later.<BR> I have to start out with three sets of these objects because the first time through the application the user might not have the information for this section, but will need to print this form with three sets to manually fill in the information and come back later to type in the info.. The user could have to enter 50 or more sets of information on this form.<BR> Does anyone have any ideas on how to create the objects on the fly, allow the user to submit the information to the database, and allow them to edit the data at a later time. Also how can I validate a form when the objects have been created at run time without unique names. Any help would be much appreciated.

  2. #2
    Join Date
    Dec 1969
    Posts
    553

    Default RE: Multiple (sets) of objects on a form

    Use Response.Write to create objects on the fly server-side. Creating objects at run time does not prevent unique names. All you need to do is keep a counter of each set and append it to the name of each object. Once you are done keep the value of the counter in a hidden field, so you can use it in your validation and your database update to iterate through the fields. Here is a REALLY simple example:<BR><BR>Dim X, strTextBox<BR>For X = 1 to 3<BR> strTextBox = "&#060;Input type=text name=Text" & X & "&#062;"<BR> Response.Write strTexBox<BR>Next<BR><BR>This will create three text boxes named Text1, Text2, and Text3.<BR><BR><BR><BR><BR><BR><BR><BR>

  3. #3
    RUSY Guest

    Default RE: Multiple (sets) of objects on a form

    1. TAKE A FORM BEFORE AND USE THE NUMBERS ENTERED BY THE USER<BR>USE THE SCRIPT<BR>FOR I=1 TO REQUEST.FORM("NO")<BR>&#060;INNPUT TYPE="TEXT" ....&#062;<BR>NEXT<BR>2.ISERT THE INFORMATION IN A SEPARATE TABLE WHICH IS LINKED WITH A COMMON FIELD<BR><BR>3.TO VALIDATE THE FORM USE SCRIPT<BR>FOR i=1 TO REQUEST.FORM("NAME").COUNT<BR><BR>--VALIDATE OBJECT(i)(E.G REQUEST.FORM("NAME")(i)<BR><BR>NEXT<BR><BR>EASY<BR >RUSY<BR>INFO@SOFTSPARK.COM<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •