Array question for input fields

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Array question for input fields

    :confused; Can you have an array for a input name field. For example:

    <input type="hidden" name="passID[cnt]" value="#id#">
    <input type="text" name="passingThis[cnt]" value="#DB_value#">

    I read a DB table displaying the data on the screen and they can change a
    couple of different fields for each of the records. All the records fields I
    want with the same name so I can just go thru the array and update the DB. I
    can display an array value fine in the calling program, but once I go to the
    called program, it gives me an error.

    Variable PASSINGTHIS is undefined.

    The error occurred in
    E:\inetpub\wwwroot\telecom\maintenance\EquipmentMa inList_PMUpdate.cfm: line 1

    1 : <cfoutput>#passingThis[1]#</cfoutput>


    I do have the cnt variable starting at 1 and going until no more records are
    listed. I even hardcoded the cnt at 1.
    I look at my debug and the value is listed:

    Form Fields:

    FIELDNAMES=TESTHOLD[1],TESTHOLD[2],PASSINGTHIS[1],HOLDRECCNT,P_ID(1),P_SCHEDULE(
    1),P_SCHEDULEMONTH(1),P_LASTMAINTDATE1,P_ID(2),P_S CHEDULE(2),P_SCHEDULEMONTH(2),
    P_LASTMAINTDATE2,P_ID(3),P_SCHEDULE(3),P_SCHEDULEM ONTH(3),P_LASTMAINTDATE3,P_ID(
    4),P_SCHEDULE(4),P_SCHEDULEMONTH(4),P_LASTMAINTDAT E4,SUBMITPM
    HOLDRECCNT=4
    PASSINGTHIS[1]=Yes it passed



    Any help would be great. Thanks.

    want-a-be Guest

  2. Similar Questions and Discussions

    1. Create Dynamic PDF with input fields
      Hi, I have conclude the way to built a dynamic PDF document with CFDOCUMENT and CFDOCUMENTITEM on ColdFusion 7. But, I need to push further the...
    2. Perl Newbie question: How would you take keyboard input and run a shell scrip with that input?
      I don't think you could be vaguer :) Very basic #!/usr/bin/perl # update.pl multiple options command line my @packages = @ARGV foreach...
    3. Create Dynamic Input Names or Input Fields in Asp
      I have a little code to add multiple items to a shopping cart based page. This code works perfect, but it adds all of the info to the same input...
    4. Creation of input fields dynamically
      kie wrote: Yes, but you're asking in the wrong place. Look for a DHTML newsgroup. There are several on this news server. Bob Barrows
    5. Formats, fields, input masks, et al
      Okay, I understand what you are saying, and the customer wants it, so the customer gets it. And you're right, even if you default the area code...
  3. #2

    Default Re: Array question for input fields

    The easiest way is something like:

    <input type="hidden" name="passID#cnt#" value="#id#">
    <input type="text" name="passingThis#cnt#" value="#DB_value#">

    Then on the Action page they would be referenced as

    Form["PassID" & i] and Form["passingThis" & i]

    Where i would be a counter for each #cnt# number on the submitting page.


    OldCFer Guest

  4. #3

    Default Re: Array question for input fields

    Larry,

    I did end up coding it a lot like you had shown. It works fine that way I
    just thought an array was a lot cleaner to use. I could get the Array length
    to use in my loop but I can get that another way.

    Thanks for the reply.

    bj

    want-a-be 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