Trouble passing a varible to INSERT page

10-11  Source: Network gathering  Views:0 

I'm a novice and I'm having trouble passing a varible from
one page into the database.
I ultimately want to pass the word "Appliances" into the
database field name called CATEGORY.
The user clicks on:
to go to the next page. Then the next page has a <form> in it
and that same page has <CFSET category=#category#>. But when
the form posts the info into the database with the <CFINSERT>
on the next page, CATEGORY is empty.
I've tried: CFSET form.category=#category#>, CFSET
form.category="#category#"> and some other things. I've even
thought of doing this: <FORM
ACTION="insert.cfm?category=#category#" method="post">, but that
didn't work either (I thought I was pretty smart when I thought of
that). :-)
Now, I have JUST learned that I can use the <INPUT
TYPE="hidden" NAME="category" VALUE="#category#"> to pass it BUT
why didnt a simple CFSET statement set the variable and pass it to
Thanks in advance!! -Tony
yes, <cfinsert> tag only inserts FORM values, that is
values defined in
the FORM scope variables (form fields, effectively). it will
not insert
any values defined in any other scopes.
a form will POST (submit) only data in its fields. that is
why the
variable you set with CFSET is not submitted - it is not a
form field.
so in order to use cfinsert you must have all data you want
to insert
into db in form fields. as you have found out, you can have
hidden form
fields to post/submit data too.
you could also pass the variable as part of the query string
of the
action page: <form
method="post">, but that variable will be available on the
action page
inside URL scope, not FORM scope. in order for CFINSERT to
insert that
variable in this case, just add <cfset form.yourvar =
BEFORE your CFINSERT tag on your action page.
et voila - your variable is part of the form scope now and
gets inserted
with cfinsert tag.
hope this helps.
Azadi Saryev
Related articles
  • Trouble passing a varible to INSERT page 10-11

    I'm a novice and I'm having trouble passing a varible from one page into the database. I ultimately want to pass the word "Appliances" into the database field name called CATEGORY. The user clicks on: to

  • How can i pass a varible from a page to another 10-11

    Hello , if i have 2 pages for example page1.php and page2.php and i have a varible at page1.php "$x=10;" and i want to pass it to page2.php to use it . How ??? bec. i am doing a site and a user enters his username and i want to use that username

  • Passing multiple values to another page via a sql report 10-11

    Having trouble passing multiple values to another page via a popup SQL report I have two fields one called "descr" and another called "Met" when I use the code below all works fine and the value of "descr" is passed Select '&

  • I have been having trouble with inserting pages in a document in indesign 10-11

    having trouble with inserting pages in a document in indesignYou're going to give us more information for us to help you. What operating system? What version of InDesign? What happens when you insert a page (and how are you choosing to insert a page)

  • Trouble with inserting pages in Adobe 9 Standard 10-11

    "Insert Pages" function was not available when trying to insert pages: from file:  is greyed out and the pdf's were created in Adobe 8 standard, did try the combine function using the merge function but the signatures were lost and it did state

  • Passing a file from one page to another 10-11

    Hello, I have a page in the application, which uploads a file. I need to pass this file to another page, where it's going to be inserted in the table with some other parameters. Is there a way to do it in Apex? for example a temporally table that cou

  • How to insert page in Pages 5 document? 10-11

    In previous versions of Pages, inserting a new page into an existing document was a trivial operation. In Pages 5, it's a total mystery. I opened a template containing text and images and played around with it to familiarize myself with the Pages 5;

  • ASP How do you go to a detail page from an insert page? 10-11

    Hi I'm building a site in asp and I have an insert page that once submitted should go to a detail page of the record just submitted. There is a unique ID field in the database that is generated by the database. I was thinking that the unique ID is th

  • Javax.servlet.jsp.JspException: Can't insert page '/common/MenuFiles.jsp' : 10-11

    Hi, I am using WebLogic 11g. In my application am getting following exception in my console ####<Jun 4, 2012 2:03:47 AM CDT> <Error> <HTTP> <> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'web

  • Trouble passing var using CFC 10-11

    I'm having trouble passing a variable value called from a CFC into Flex via RemoteObject. Basically I'm trying to pass the current logged-in user to a Combobox as a string. The Web directory in IIS is set to dissallow anonymous access and is set to I

  • How to pass date parameter from one page to other in BSP application 10-11

    Hello gurus, In my BSP application i have taken an input field and made its type "date" and its value also of type date and have set showhelp . Now once a particular date is given as an input i want to pass its value to next page. And in next pa

  • Passing parameters from one OAF page to another OAF PAge 10-11

    Hello I was wondering, if there is a possibility of passing request parameters from one page to another page in EBS ( E-Business Suite). I tried using the following a) PageContext.putParamater ( "MyParamater", "ParamaterValue") b) I ad

  • Pass parameters from JSP Dyn Page to WDJ Application 10-11

    Hi, I am trying to pass parameters from my JSPDyn Page to WDJ Application. I am using NWDS 7.1 EHP1 My code is : function to_WEBDYNHK()       EPCM.relaxDocumentDomain();       EPCM.doNavigate     ('ROLES://pcd:portal_content/Himanshu.Himanshu/TestDyn

  • Problem in passing data from one .jsp page to another .jsp page 10-11

    i have a problem here Actually i have 2 jsp pages. What im trying to do here is actually i want to pass data from the first jsp page to the second for updating The first jsp page contains data that user wants to update in the form of table. <td><

  • Insert pages from a single document multiple times 10-11

    I'm trying to create a simple program that I can use to display PDF files that I can use to play at the piano. I perform often, and need to create "play lists" from which I can pull all, or part of, a PDF file containing music and display it. I

  • Passing the values between two pages 10-11

    hi all, I am trying to pass the value from one page to another page. by referring the Link I have created the code based on the demo. it is deployed without any issues. but when i press the h

  • How can I pass a value into a page fragment? 10-11

    How can I pass a value into a page fragment? I am implementing four search screens. And the only thing different about them will be their backing bean. So I'd like to do something like have four pages, each which retrieves its appropriate backing bea

  • How to insert page numbers in document 10-11

    How can I insert page numbers using Pages starting with the second page of the document?click where you want the numbers > Menu > Insert > Page Numbers At the end of the first page: Menu > Insert > Section Break Click in the 2nd page: Inspe

  • How to insert page numbers in word 10-11

    I know how to insert page numbers that appear 1, 2, 3 etc. But I want to display:    1 out of 6,   2 out of 6,  3 out of 6  or similar - i.e. to have the TOTAL number of pages shown.  I can do this in Excel - is it possible in Word?  Or Pages?? Thank

  • How to insert page numbers in a PDF document? 10-11

    How to insert page numbers in a PDF document using Adobe Acrobat X Pro 10.1.2? Thanks.OK, I found it myself: 1. Tools - Pages - Edit Page Design - Header & Footer - Add Header & Footer. 2. Select the font and size, etc, place the cursor on the app