Professional Web Applications Themes

Passing A Form Variable - Coldfusion - Getting Started

:confused; Hello all, I'm trying tu modify information that is changed by the client. I'm using the master id number in the WHERE clause of the SQL statement. However, when the client clicks the submit button it actually sends three of the master id number. For example, if the master id is 67 then this is what's passed: WHERE master_id_number = '676767' I'm using a hidden form input tag to pass the variable. I've never run into this before and would appreciate any help. Thanks, Daren...

  1. #1

    Default Passing A Form Variable

    :confused;

    Hello all,
    I'm trying tu modify information that is changed by the client. I'm
    using the master id number in the WHERE clause of the SQL statement. However,
    when the client clicks the submit button it actually sends three of the master
    id number. For example, if the master id is 67 then this is what's passed:

    WHERE master_id_number = '676767'

    I'm using a hidden form input tag to pass the variable.

    I've never run into this before and would appreciate any help.

    Thanks,
    Daren

    drdagwood Guest

  2. #2

    Default Re: Passing A Form Variable

    Can you post the form code (where you create the hidden form field) and action page code query?
    mxstu Guest

  3. #3

    Default Re: Passing A Form Variable

    Sure here you go:

    Thanks,
    Daren

    <cfoutput query="blah">

    <input name="Master_RFI_ID" type="hidden" value="<cfoutput>#Master_RFI_ID#</cfoutput>">

    other fomr code in here

    </cfoutput>
    drdagwood Guest

  4. #4

    Default Re: Passing A Form Variable

    I'm not sure what the rest of your form is doing, but I don't think you need
    the nested CFOUTPUT within the INPUT tag. Since the INPUT tag is already
    within a CFOUTPUT loop, you don't need the extra CFOUTPUT tag.

    <form ....>
    <cfoutput query="blah">
    ...
    <input name="Master_RFI_ID" type="text" value="#Master_RFI_ID#">
    ...
    </cfoutput>
    ....
    </form>


    However, you may run into another problem if query "blah" returns more than
    one record. In this case, you will end up with multiple form fields named
    "Master_RFI_ID", which will get passed to the action page as a comma delimited
    list. So for example, if your query returned 3 rows, the value of
    #form.Master_RFI_ID# would be something like "67,67,67".



    mxstu Guest

Similar Threads

  1. Passing Dynamic Variable In A Hidden Form
    By Chizzy66 in forum Macromedia ColdFusion
    Replies: 6
    Last Post: February 25th, 03:49 AM
  2. form variable passing
    By realtime158 in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: January 9th, 02:26 PM
  3. Passing form entry to URL variable
    By benkayuk in forum Macromedia ColdFusion
    Replies: 1
    Last Post: April 7th, 07:28 PM
  4. Passing form variable
    By Nifkins Bridge in forum Macromedia Dreamweaver
    Replies: 1
    Last Post: July 17th, 09:15 AM
  5. Replies: 1
    Last Post: July 7th, 04:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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