Analyze the form variable to insert in my query

I got a report where I want out of the group. The only problem is the field that I want to group comes as a deliimeter by commas of the form.

If I use the in() function is not properly output group.


#form.id # < cfoutput > < / cfoutput > < br > < br >
< name cfquery = "" datasource = "MyDSN" >
SELECT *.
FROM MyTable
Identification number WHERE in (#form.id #)
< / cfquery >

< cfoutput query = "that" group = "id" >
#id # < br >
< cfoutput > #name # < br > < / cfoutput >
< / cfoutput >


Output-
2
Jones

2
Smith


But if I use a value of form at a time correctly includes my output:

< name cfquery = "" datasource = "MyDSN" >
SELECT *.
FROM MyTable
ID WHERE = 6
< / cfquery >


Output-
2
Jones
Smith

Please tell us how I can take the values of the form and enter one at a time in my cfquery?
I guess I need to parse the output of form.id and then browse each value to insert in my cfquery but don't know how I can do this?

An ORDER BY clause in your SQL query could also help. But this isn't your SQL query, that is the problem, is how you put your output format. In addition, you don't need nested CFOUTPUTs.

Tags: ColdFusion

Similar Questions

  • ActiveX in BradySoft (CodeSoft) - what method/class/object I would use to send data to the form variable to BradySoft?

    Can what method/class/object I use to send data to the form variable to BradySoft? I have a basic configuration of BradySoft label and I want to send it data of variable shape (a serial number) from Labview ActiveX. I joined guide Brady ActiveX programmers, but can't understand what to use for that.

    P.S. I would call Brady or TekLynx tech support on this issue, but they have a strict policy while BradySoft supports ActiveX, but does not provide technical support assistance programming with it. I thought I would try the Forums OR.

    Just an update. I could get this to work myself after a few days of playing with it (I suppose that the best way to learn!). I have attached a sample VI for anyone interested. Can we Kudo ourselves?

  • By the way the form variables

    HI ~

    I have a form on my index.cfm page, and the action takes place to access a page of confirm.cfm. On this page, I want the user to be able to look at the information entered into the form and then press 'Submit', if they are correct. Right now, I am able to display the information from the form on the page confirm.cfm, but I'm having a hard time with my insert statement. At the present time, when I hit the final submit button, an entry is created in the database, but none of the variables are passed. I'm guessing it's because the cfparam = default "" setting, but I don't know what to put as - if I try to set it as semester or form.semester, he said is not defined. " Help, please! Thank you!

    You must make sure that the form.semester variable is considered a variable... use # tags and...







    Phil

  • Use the session variable in insert record

    Help, please!

    I need to add a record to a table; one of the fields in the table is the user_id. When I try to use the insert record server behavior, there is no way to select the session user_id variable! How this is done?

    > I need to add a record to a table. one of the fields in the table is the
    > user_id. When I try to use the insert record server behavior, there is no
    > way
    > to select the session user_id variable! How this is done?

    Use a hidden form variable and assign the value of the session.

  • Passing the form variables to a thank you page.

    Hi all

    I have put code in place so my survey form transmitting data hidden on a confirmation page and displays the appropriate data. for example

    tag_reportid = 222776

    tag_displayname = Point 26



    My form script is:

    " < form name ="catwebformform3235"method ="post"onsubmit ="return checkWholeForm3235 (this)"enctype =" multipart/form-data"action =" https://BAFs.worldsecuresystems.com/FormProcessv2.aspx?WebFormID=72629 & pageid = %2thankyou.htm? name = {tag_reportid} & amp; titlename = {tag_displayname} & amp; OID = {module_oid} & amp; OTYPE = {module_otype} & amp; EID = {module_eid} & amp; CID = {module_cid} & amp; CC = {module_urlcountrycode} & amp; Sponsor = {module_siteurl, true, true} ">"

    What I see on the receipt/thank you page, is that only the name field has been spent... thankyou.htm? name = 222776,... then it is not passing the titlename field.

    In fact, it seems that it won't any variable after this first field 'name '.

    How can I get the form to send any variable I need more on page of thanks? Thanks in advance.

    Sure thing if your not comfortable with javascript, I created this one liner for you and an example of work (I wrapped the shape with a border of style so that you can see on the page, obviously to remove when you want to go live). I coded only the first two points, if you find that you do others (of course), and then wrap them also.

    Form here

    Example:

    https://jsfiddle.NET/rsy9bxyp/1/

  • How to filter the form entries before inserting into the database?

    Hello Adobe Forums,

    This is my first post and im a beginner with dreamweaver. I have created two forms on my site, one for messages (contact form) and the other for the testimony. I used the server behavior record insert to insert the record into the database, and then display the record in my administration area. What I want to do is to make sure that nobody can put the code in one of the entries, and if they do then to strip out code before its insertion in the database. Anyone know how I can do this? I'm not a coder I just use dreamweavers Insert menu, but I can change the code if somone told me what to do and where.

    Thanks in advance

    Dang - sorry-

    foreach ($_POST as $key-online $value) {}

  • Is there a way to change all the variables of the form variables URLs?

    Is it possible to change or copy all the variables in the url, so they have a scope limited as variables of form with a single statement?

    For example:

    < cfset form.var1 = url.var1 >

    < cfset form.var2 = url.var2 >

    < cfset form.var3 = url.var3 >

    Is this possible with a single statement?

    Have you tried:

    OR

    I'm not 100% sure that you can add to the scope of the form like that in all versions of the CF.

    If not, you can work with a thrid variable that you incorperate both form and url variables in.  It is a common technique in the fuse box, I think.

  • Validate 2 fields of e-mail in the form of disks insert

    Hello

    I used the wizard insert a record form to create a form, including using the form validation server behavior to validate multiple fields.

    I can't understand how to compare and validate 2 fields for email address.

    After the form has been created I open the validate form behavior of existing server - Advanced tab and built the condition {sub_email2}! = {sub_email}, but this had no effect on the form.

    The other thing I tried was creating a new behavior to compare the Transaction field with the same condition {sub_email2}! = {sub_email}, also seems to have no effect.

    I'm just a beginner, so I admit not really knowing what I'm doing, for me uninstallation has been a great help.

    The other thing I noticed, when I tried both the above, not to mention that without impact on being able to submit the form with different e-mail addresses. Red asterisks, which indicates a mandatory field, would disappear.

    Here's the form http://www.oescahealthregistry.org/forms/pedigree_submission.php this version of the form does NOT include any of my attempts to validate the E-mail fields.

    Thanks in advance for your help.

    Dennis

    Hello

    A comparison statement should work fine. For example, I did small format which inserts the name and email (2 courses) help Insert record Wizard.

    The name field is required, the email field is mandatory and ensures that it is a valid email ([email protected]) structure. I then finish the wizard.


    displayFieldHint ("email");? > displayFieldError ("email", "email");? >

    ---

    I then add the extra field to the form that the 2nd e-mail will be concluded, this one I called him email2, I then copied the code hint display and fielderror of the first email and placed behind the 2nd email and change the text to reflect email2. Which probably isn't serious, but I put it here anyway.


    displayFieldHint ("email2");? > displayFieldError ("email2", "email2");? >

    ---

    Now that I have two e-mail fields in the form, I go to the developer server behavior under tools and select compare fields of operations to the title of the form validation.

    I hit the + to add a field I can select e-mail for the domain, and == for condition, then {POST.email2} to compare. I get into an error message and click ok.

    She's the form is ready.

    The first email field will check against the e-mail validation and the 2nd E-mail will check against the first e-mail.

    I hope this helps.

    ---

    Please note that the database only has 2 fields to enter data. Then 2nd email field is only for validation.

    Post edited by: Albert S.

  • by comparing the form variable to the result of the query

    Hello
    I'm trying to compare a form variable to what is in the database. Two transmitted variables - "form.employid" and "form.class". If the person chooses the wrong class or made a typo, then I get an error message. It sounds pretty simple, but I just don't get it. I want to compare "form.class" with COURSE_TTTLE in the database. If the "form.class" that the user selects does not match any COURSE_TITLE s in the database then I want to raise an error and told recheck. Here is my code

    < IsDefined ("form.employid") cfif >

    < cfquery name = "all" datasource = "hr1" >
    Select EMPLID, COURSE_START_DT, COURSE_END_DT, SESSION_NBR, COURSE_TITLE
    Of PS_TRAINING
    WHERE EMPLID ='#FORM. EMPLOYID #'

    < / cfquery >
    < / CFIF >


    It works well on it, but it's the cfif with that I have a problem. Here's the problem code:

    cfoutput query = "all" >
    <! - if the employee id and the title of the course are not in the same record, then run a mistake - >
    < cfif TRIM ("form.class") eq ' #COURSE_TITLE # ' >
    We do not show you as having enrolled in the course. Please check your employee ID and reselect a course.
    < cfabort showerror = "No class" >

    < cfelse >

    #EMPLID # #COURSE_TITLE
    < / cfif >
    < / cfoutput >

    I thought about it - you must use compare (form.class, #COURSE_TITLE #)

    Then use cfswitch to compare and send the appropriate response. Here is the solution:

















    This is the default case





    #expression #.

  • How to pass the form on a table after a query?

    With the help of Oracle 11.2 and Apex 4.1.
    1. I use a form on a table with buttons: QUERY, INSERT, DELETE and CANCEL.
    2. after INSERT and DELETE, the shape is erased.
    3 but I would remove the form after the QUERY. Well, I want to clarify when the user wants to that he erased!
    4. and, in fact, I have a process to clear the Cache for the button CANCEL.
    5. when I click on CANCEL, there is a flash like redraws the screen.
    6 and I think this is the case, is that after the cache is cleared, the variable RCD_ID of the page has the prior value and treatment of the "table row" retrieves the file once more.
    7 so I return values that I wanted to clear! Looks like I'm being undermined by the functionality of the ARF. (ARF, ARF!)

    1. I tried to change the "Go to page nn" to clear the cache for the page, but that seemed to make no difference.
    2. I tried to adjust the page RCD_ID variable to "as I do after DELETION, but that has not worked either to CANCEL.

    Thoughts?

    I guess it's just me, but the extremely annoying part of the APEX is that some simple obvious things – like the form of compensation - have no obvious simple solution. I would say, there are a few obvious approaches, but none seems not to work. You would think that a 'CLEAR' button would be a standard button or CANCEL to had an option to clear the form and or clear a list of items on the page.

    Howard

    Howard (DBA in training) wrote:

    For the button CANCEL, 1) I clear the cache of the page and 2) I put the variable RCD_ID (P2_RCD_ID) ". But without effect. When I consider the debug report, I don't see any indication that CANCEL was pressed or that these processes have been executed. So, maybe they are not running. I see the record being extracted again - which is what I want to avoid.

    Processes are not executed because the page is not submitted. The Cancel button does a redirect, not a shipment:

    apex.navigation.redirect('f?p=21997:2:13040303230582::NO:::')
    

    Change the button action to present, with the value of the request as "CANCEL".

    By default, generated by the wizard Cancel button will be created to perform a redirect. The anticipation is that the behavior required to navigate to another page in the application without changes to session state or process.

  • Problem/Question about the form Variables and nesting?

    Hello

    I need to create a fairly long list of checkboxes for a user to fill out.  I created a table of database with each checkbox item stored as a line, and using a cfquery I can select in the database and add them to a form as such:

    < do action = "postact.cfm" method = "post" > "

    < cfoutput query = "getquestions" >

    < input type = "checkbox" name = #getquestions.shortname # > #getquestions.longname # < br >

    < / cfoutput >

    < input type = "submit" value = "Submit" >

    < / make >

    The problem is when I try to refer to these items on the next page.

    Instead of naming each one individually, I was hoping to use another query to pull the name of the box and be able to reference it.

    Problem seems to be that I can't refer to them as a variable name, I thought I could do something like this:

    < cfoutput query = "getquestions" >

    #form.shortname #.

    < / cfoutput >

    .. but it does not work because #form.shortname # is not a valid variable.  What I really need, is form #. # getquestions.shortname #, if that makes sense.  Is this possible?  Nesting of a variable inside a variable name name?

    As a demonstration, place the following code in postact.cfm and it will display the name and value of each form field:

    
      
        form.#shortname# = #form[shortname]#

    See you soon

    Eddie

  • I'm trying to exit through the form variables request...


    < name cfquery = "cr" datasource = "' #session.db # ' LignesMax '10' = >"
    SELECT #form.collist # OF #session.tn #.
    < / cfquery >
    < cfoutput >
    < strong > SELECT < facilities > #form.collist # < strong > SINCE < facilities > #session.tn #.
    < / cfoutput >

    < cfdump var = "#cr #" >

    < cfset #collist = strList # >
    < cfloop index = list 'index' = "' #strList # ' delimiters =" #chr (13) ##chr (11) #">"
    < cfset total = ListLen (strList) >
    < / cfloop >


    < table align = "center" border = "1" >
    < b >
    < cfloop index = 'z' from = "1" to = "#total #" >
    < td > < cfoutput > #trim (listGetAt('#index#',Z,',')) # < / cfoutput > < table >
    < / cfloop >
    < /tr >
    < cfoutput query = 'cr' >
    < b >
    < td > what shoud I use your to display the query < table >
    < /tr >
    < / cfoutput >
    < /table >

    Here's a quick example which may help you.

    
    
    
    
         SELECT #colList# FROM #tableName#
    
    
    
    
    
         Report
    
    
    
    
    
              
                        
    #HtmlEditFormat(colItem)#
    #HtmlEditFormat(report[colItem][report.currentRow])#
  • Use on the form variable

    Where can I put my variable user planning?

    Read - http://download.oracle.com/docs/cd/E17236_01/epm.1112/hp_user/user_var.html
    File, then Preferences > Options user variables

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to insert a username of the form page access page

    Hi friends,

    I created an apex of database application in which it consist of three pages...

    login page 1) - > 1
    form 2) page with page report (in the same page), that is, I have created a region within a form region report
    form page 3) (this page is displayed when I click on the option change in my previous report page)

    (i.e.) my 3rd page of form depends on my 2nd page of report, because not long after I click on the edit of each line option in my report which is on the 2nd page, he has to go to the 3rd page of form corresponding to a updations in each row.

    I created my applications listed above...

    But the scenario for me because the login page contains two fields, i.e.

    user name:
    password:

    so I'll give my name in the user name and PW respective to access my page of 2nd and 3rd in my request...

    Given that my 2nd page of the form consists of the following fields you

    user name *)->
    *) assigned to
    status *)
    start date *)
    priority *)

    My requirement here is therefore shortly after I logging into my application via the username and PW on the second page, coming on the second page of the form

    my username in my 2nd page of the form should be inserted automatically with the user name that I entered the login page...

    example: my user_name in the login page is: harry

    After being passed in the second page of the form with the user name "harry."

    my 2nd page of the form 'username' field must be automatically generated with the name 'harry '.


    Of the friends as possible to do this in my application... I have not any idea of it... Kindly help me friends to resolve my screenplay... Please explain each step in detail...

    Since the user_name: harry, is of I got the side admin as a developer for the workspace...

    Thanks in advance

    Harry...

    Hello

    Under the heading "Source: region selection

    Source: replacement always, value that exists in session state
    Source type: column database

    Default value: APP_USER

    Kind regards

    Patel Kartik
    -----------------------------------------------------------------------------------------
    http://patelkartik.blogspot.com
    http://Apex.Oracle.com/pls/Apex/f?p=9904351712:1

  • RADIOV element is not defined in the FORM

    Hello
    I have this.
    I want to insert values such as blue, yellow or red
    in the field of database col_Radio.

    what I have to change to make it work?

    Thank you

    ERROR:

    RADIOV element is not defined in the FORM

    Exceptions

    15:53:22.022 - term Exception - in C:\CFusionMX7\wwwroot\ACT_inputcolor.cfm: line 10
    RADIOV element is not defined in the FORM.

    Note: line 10 is "#Trim (Form.RADIOV), #

    --------------------------------------------------------

    What I need to change to the radiov element to define or is this the only mistake?

    In other words, the FORM variable name must be identical to yourname of the field.

    When you submit your form, this

    Becomes
    #FORM.group1 #.

Maybe you are looking for