Dynamic form problem

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Dynamic form problem

    I have a form that generates dynamic fields that the user can fill. The problem
    I'm having is with the form processing. So for example if a user created three
    new lines each containing 4 fields of input (eg. name, addr, zip) i need to
    check that each line has every single line filled before i process it.

    As for now I name every field the same thing but add a number to it, so for
    instance if the user creates a new line then the name field is "name1" because
    it is in line 1 line 2 would contain "name2".

    The problem is in the processing, i have an idea of what i want to do but cant
    do it. I create an index loop and loops through but when i try to create
    form.name#i# i get an error. The error says form.name does is undefined, so it
    does not add the #i# variable to form.name before evaluating. I also tried
    form.name&#i# and i still get the same error.

    So right now I'm stuck. I dont know how to evaluate the dynamic fields. Any
    ideas?

    Thanks.

    kelryu Guest

  2. Similar Questions and Discussions

    1. Ins. Record from dynamic form problem
      XP Pro, CF 6.1(built in webserver), MySQL 4.1.13, DW MX04, I am trying to insert a records from a dynamic form. I created it all in Dreamweaver MX...
    2. Insert record from dynamic form problem
      XP Pro, CF 6.1(built in webserver), MySQL 4.1.13, DW MX04, I am trying to insert a records from a dynamic form. I created it all in Dreamweaver MX...
    3. Dynamic form to create pie chart - problem reprentingthe data not selected by user
      I have created a pie chart based on what a user select on a form. For example, a user can select from a list of species they want to view a pie...
    4. Creating a Dynamic form
      I want to create a form where the user enters their family members' names and ages. An input on the form will ask the user to enter the number of...
    5. Dynamic form population
      The addition of flash & XMl forms in CFMX7 is great. Just wondering if there is a way to dynamically populate a field based on another (i.e. from...
  3. #2

    Default Re: Dynamic form problem

    FORM is like a structure. You can access form field values using array
    syntax, like:

    <cfloop .... index="i">
    <cfset localName = FORM["name"& i]>
    <cfoutput>#localName#</cfoutput>
    </cfloop>

    Btw, you may also want to search the forums. Handling dynamic form fields is
    a popular question :-)

    mxstu Guest

  4. #3

    Default Re: Dynamic form problem

    Thanks. Problem solved and next time i'll be sure to use the search button first.
    kelryu Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139