Please help with dynamic form field names in cfloop

Hello

I need to create a form with day, date, month, year and time for 12 months

Instead of coding them 12 times, I create fileds day, date, month, year and hour in my form 1 time, then I use cfloop from = "1" to "12" = index = 'i' to these fields in form loop 12 times.

I gave each form field name such as: < input type = "text" name = "' ScheduleDate_ # I #" value ="" > this way, each of these fields will be named differently: ""

ScheduleDate_1, ScheduleDate_2, ScheduleDate_3, ScheduleTime_1, ScheduleTime_2, etc.

I am facing problem when this form is sent, I think that the error has something to do with the number sign (#) when it comes to update the back-end

I use MS SQL

He doesn't like this:

< CFLOOP From="1" To="12" index="k">

< CFIF Len(Trim(Form.MeetYear_#k#)) NEQ 0 AND Len(Trim(Form.MeetTime_#k#)) NEQ 0>

< cfquery name ='CreateSchedule' datasource =' #DSN # '>

UPDATE TableSchedule

The VALUE SchedDay = < cfqueryparam cfsqltype ="cf_sql_varchar" value ='#form. SchedDay_ # k'>.

SchedMonth =

< cfqueryparam cfsqltype ="cf_sql_varchar" value =' #form. . "AnnMonth_ # k '>.

SchedDate =

< cfqueryparam cfsqltype ="cf_sql_varchar" value =' #form. . "SchedDate_ # k '>.

SchedYear =

< cfqueryparam cfsqltype ="cf_sql_varchar" value =' #form. . "AnnYear_ # k '>.

SchedTime =

< cfqueryparam cfsqltype ="cf_sql_varchar" value =' #form. . "Anntime_ # k '>

SchedId = < cfqueryparam cfsqltype ='cf_sql_numeric' value =' #k # '>

< / cfquery >

< / CFIF >

< / CFLOOP >

Can anyone help please?

You cannot nest sharps. Do this instead:

SET SchedDay =

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Tags: ColdFusion

Similar Questions

  • where can I find default user to IOM form field names

    Hi all


    where can I find defalut user form field names to the IOM. BCZ I want to use this name to create tasks for updating the form user field for processing the form

    In my case I want to know the user of the status of the user domain name


    plsss help me in this

    see if you want to update the values of the fields defined by the user of the form for the user to process the form then to design console go to the Administration tab-> user defined scope - search for folder "Users" in this form, you can get your name in the column for the field of the UDF.

    It's USR_UDF_CELLPHONE add this entry in the definition of research: Lookup.USR_PROCESS_TRIGGERS and the name of the task for example change of cell phone.

    Try this and let me know. It should work.

    Thank you
    Patricia

  • Please help with download. ?

    Please help with the download?

    Available downloadable Setup files:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

  • Get error 207 trying to download creative Cloud and someone please help with this problem, thanks in advance please.

    Get error 207 trying to download creative Cloud and someone please help with this problem, thanks in advance please.

    Please refer to

    Error 207 to "install Adobe".

  • I need to reactivate Photoshop CS4 because I have a new hard drive in a reminder for my 2.5 yr old iMac last operating system running. When you open the program, I was told to contact Adobe support and give them an error code: 150:30. Please help with per

    I need to reactivate Photoshop CS4 because I have a new hard drive in a reminder for my 2.5 yr old iMac last operating system running. When you open the program, I was told to contact Adobe support and give them an error code: 150:30. Please help with permission. ?

    You can repair it yourself. I have a screenshot guide. You use app the Mac Terminal and a python (.py) script that comes with the recovery of the license for the Mac package.

    Don't forget to leave a space after typing sudo python and note that your password will not display any points. Simply enter it blind.

    Start 11 Message and take your time. It does not work. Layout error 150:30 opening Photoshop cs4 on Macbook Pro

    Gene

  • Update database with several form fields with the same name

    If I've made good progress on my CF photo album project, but now I meet a problem.  Once I downloaded a collection of photos and them inserted in my database, I bring up a page that is actually an array containing the thumbnail of each image, some info on it and the description of the photo.

    The table is inside a < form > tag, and the description is a < textarea > tag.  I have many text boxes that I have pictures, so there may be any number (within reasonable limits).  I'd like to be able to type a description for each picture in each text box rather than having to do one at a time, and then click the button submit to update my file.

    Each text box has the same name, so I had the idea of adding a hidden form field that held the photo ID, then on the processing page, I might have a < cfloop >.  My problem is that I can not understand how to associate each photo with the corresponding description ID, especially if we consider that some of the descriptions may be empty.

    Is there a good way to do this?

    As you probably understand, giving all your textareas eponymous means that when the form is submitted, you get a value that is a list of the contents of each text box comma-delimited.  If none of the commas are typed in the text box, you have a problem.

    My preferred method is to include some sort of identifier as part of the name of the form field.  Since you have ID photo available, I would use those.  This would give your names textareas as description_111, description_112, etc.

    When the form is submitted, I loop through the form.fieldnames list.  If the first 12 characters are 'description_111', I can remore 12 characters to get the id.  I also have the content of the text box using the array notation.

  • How can I read a PDF form with c# code. Can someone please help with the snippet of code or documentation.

    My requirement is to read the full user of PDF form fields using c# code.

    Any code snippet or a document will help.

    Thank you

    OK, Acrobat and the Acrobat SDK kit are not for the server. But Alice has produced s called LiveCycle business that had a Java API. This can help. It's enterprise software and not the same as LiveCycle Designer. There is also the Adobe PDF Library, which is C++.

  • Company Logo Image dynamic form fields

    Hello world

    I designed a dynamic form of livecycle with fields for users. In this form, I want to insert an image field in the upper left corner of the page so that users can simply add their logo to business here. I have some doubts and need some clarification on a few issues I don't know how to:

    (1) I realize that I have to use the 'Field of the Image' object so that users to import the image of the logo of their computer. It's pretty simple. However, is it possible for me to add a default image in this area which says something like "Add your logo here" and I want this default image to not display on the screen only and not in print if the user has not inserted his own logo? Is there a way to do this?

    I had a quick glance and I couldn't find anything that can answer that for me. I was thinking about it and what I've done so far is, I added another 'Image' object in the same place and I added the photo "Add your logo here" in this area. I then put his presence '(screen only) Visible' and place this object located behind the object from 'field of the Image. Bascially as long as it does not, if the user adds a logo using the field of the image, this image overlaps the 'image' object that lies behind all this. What is the right way to do it? Or y at - it another simpler way to do this?

    If what I did above is the only option, then I see that there are some limitations to it. Let me explain... Lets say that the image in the 'Image' object are the size of 2 inches wide X 1 in height. Yes, if the user places an image of the logo using the "field of view" object above that, and if the size of the logo of the user is smaller than the image on the ground at the back (let's say the user logo is only 1 in. X 1 in. height width), then when the logo image overlaps the excess width of the image behind appears and it looks bad on screen. Hope this makes sense... Wondering if there is a way around this? I use 'Fit the picture proportionally' instead of 'Scale to fit Rectangle Image' for the image field object.

    (2) another thing is, once the user inserts an image using the "Image object" field, is it possible for the user to delete this image if the user subsequently changed his mind and does not want to add a logo to it? Do I need to add a button so that users to erase the images they have added to the image field object? If so, can someone help me with the jscript for this?

    Thanks to everyone who took their time to read... Looking forward for your answer...

    Hello world

    Just an update regarding my Question 1 above:

    I struck out my old idea of placing an object image behind the object of field of view etc... etc... to show a hidden default image for logo insertion. Instead, what I've done is now, I only use the Image field object and have incorporated the image of 'Insert here the Logo' by default for this field. Beside that, I added the button 'Clear Logo' that basically clears the image in the image field. So here, if users add their logo, they simply click on this object and add their logo that will replace the default image in it. Or, if the user does not want to add any logo, they need to click on the button "Erase Logo" to rid the default image. I think it's probably better than the other method than I thought before. The only thing here is, I have to make sure that users are aware that they need to press the button 'Clear the Logo' if they want to erase the default image, otherwise it will eventually print as well.

    If anyone has any suggestions or do the same thing differently, please inform me.

    Thank you...

  • Please help with javascript

    Hi all
    In my application, there is a colujmn in a table with the date field (calendar) and 2 other fields. The user is not allowed to enter later in the date field, I used a javascript script and it worked fine, but later I discovered that this works only for the future date, (not months or year) assume that, if the date is November 15, 2010, the error is thrown, otherwise if the date is October 15, 2010, error is thrown , for dates like December 10, 2010, December 10, 2011... error is not thrown, that is to say in the coming months and the year is NOT thrown.
    I used the code below:
    < script language = "JavaScript" type = "text/javascript" >
    function test (SAVE)
    {
    for (var i = 1; i < = 30; i ++)
    {
    "" var i1 = i + "";
    if(i<10)
    I1 = '0' + i;
    var datval = document.getElementById("f04_00"+i1).value;
    If (datval! = null & & datval > ($v ('P10_FUTURE_DATE')))
    {
    Alert ("You entered at a later date that is not valid.");
    document.getElementById("f04_00"+i1).value = ";
    document.getElementById("f05_00"+i1).disabled = true;
    document.getElementById("f06_00"+i1).disabled = true;
    counter ++;

    }
    on the other
    {
    document.getElementById("f05_00"+i1).disabled = false;
    document.getElementById("f06_00"+i1).disabled = false;
    }
    }
    if(Counter==0)
    {
    doSubmit (SAVE);
    }
    }
    < /script >

    If the incorrect date is selected, the first value in the column is disabled and the other columns fades.
    Another problem I'm facing here is the calendar does not close when you selected the value, I have to close it manually.

    Please help me with the code!

    Hello

    OK - you should check the settings on the report and the process.

    For each column in the report, check that reference parameters owner of the Table, name reference Table and column name of reference are executed correctly. Note that the reference column name must match the name of the column or the name of the alias, as defined by the SQL statement.

    For each process, make sure that the owner, Table and primary key column name are executed correctly - it should be the same for all processes in the form of tables.

    Andy

  • How to make dynamic form fields updated?

    This is going to be an ugly post, just be careful! :)

    I have a form that retrieves his labels and text input field names dynamically from a database. Rather than having the form hardcoded, we are able to add new columns to a table and the form automatically adds the new labels and fields via CFQUERY.

    When the form is completed and submitted (post method), the database is supposed to be updated. However, because our names of input fields are populated through query, we can not write a query to update static when we add new elements of form.

    So, I have a solution to this (in my head), but I'm stuck in a bit of logic and can't get it in the code. I'm looking for a way to write FORM #. # fieldname # (here is where it gets ugly). Because the form sent by the post method, I find myself with a bunch of FORM.fieldname on my action page (and fieldname is generic for what are real variables).

    So here's how I am update:
    I have a table (let's call it table1) that contains a column of all the column names in the data table (table2). This table is used for query purposes only, no data is updated here of the form.
    I have a table1 request to call all the column names in table2.
    < cquery datasource = "exdb" name = "exname" >
    SELECT ColumnName
    FROM table1
    < / cfquery >
    Then I write the update query that will update the elements they are loop using CFOUTPUT:
    < CFOUTPUT QUERY = "exname" >
    < cfquery datasource = "exdb" name = "exupdate" >
    UPDATE table2
    SET #columnName # = #FORM. < columnName > #.
    WHERE itemID = #FORM.itemID #.

    It's my dilemma. As you can see, the cfoutput is a loop... So we will take the first element in the loop, call him 'name1 '. So our query update said SET name1 = #FORM.name1 #, and it will update the table with what was presented in the entry for name1 field. The cfoutput to loop again, this time it's of name2. SET name2 = #FORM.name2 #. Now, the form includes a hidden itemID to specify where the table should be updated, as you can see above. So, now that you see how it works, my problem is to get #FORM. < columnName > # FORM.name1, FORM.name2, etc.
    In Coldfusion, you would write #FORM.variable # to call a FORM element. However, given that the variable is not defined, and allows us to fill a request, we make SHAPE #. #variable # where #variable # must be resolved before #FORM. ___ #

    You are with me on this? This is very complex in the explanation, but if you need more information, I can provide more clearly. I would like to know what you think. Really, I have the solution, but to FORM #. # columnName # to solve is another problem. I think what I need is to understand the order of operations for this statement, so #columnName # resolves first.

    You'll want to use the scope structure notation when dealing with your form variables. The Form.SomeVar variable can also be written as ['SomeVar']. Using this syntax, you can do something like this:

    UPDATE table2
    SET #columnName # = #FORM [columnName] #.
    WHERE itemID = #FORM.itemID #.

    You can also look on the following to help optimize your code:
    (1) learn how to use - it could speed up your code a bit.
    (2) according to the DB that you use, you may be able to combine all of your UPDATE within 1 SQL commands block. This will allow to do all your actions with 1 DB connection database, instead of a bunch (works in MSSQL, Oracle or MySQL, not sure)

  • Need help with a form of 9 pages

    I created a PDF form from single page with MANY fields of form (most of them, the boxes). I need to duplicate the page/form an another eight times while I have the same shape on more than nine pages. My problem is that if I do not change the names of form fields on each page (which would take a VERY long time), gets soon as something checked on the first page, it will also will be checked on the eight other pages. Is there a way to make my form of nine pages to work without having to re - appoint each form field? Thanks for any help you can provide! I work in Acrobat 9 standard on a Windows computer.

    If what I look at you, that's what you have entered in the console, then you must add a new line just before the "while" keyword

  • Please help with errors in Flash and create JS Toolkit.

    I'm trying to make a menu in the Toolbox CreateJS so I can put in my site as text replacement for no flash, iOS devices in particular.  I get an unstable overview of error messages and the menu I do not completely understand.

    "Chassis numbers in EaselJS start at 0 instead of 1. For example, this STOP button and gotoAndPlay calls. (20) ' I use image tags to avoid this exact situation, this error doesn't affect the output to HTML5 or is it a warning error message that I can't ignore.

    "Feature not supported: TLF text." Use classic text. (2) I deleted all of the text in this project, breaks out the text in the line art, which has removed all but 2 on this error message.  Is there a way I can find the two that I have left.  I went through all, and yet I can't find the keyframe with these two text entries.

    Other error messages have developed but I donot have a number next to the message so I'm assuming that the output window displays all errors and those with numbers next to them is those who count in this project.  If this isn't the case, please let me know.

    I post the FLA file, but this forum does not allow more than anything.  Here is the full error message that I get from the output window:

    WARNINGS:

    Supported text is limited. It is generally recommended to include the text as HTML (see DOMElement) elements.

    Feature not supported: TLF text. Use classic text. (2)

    Feature not supported: masks.

    In EaselJS frame numbers start at 0 instead of 1. For example, this STOP button and gotoAndPlay calls. (20)

    Buttons are published as MovieClip symbols without interactivity.

    Entry and static text fields are published in the form of dynamic text fields.

    The result of this is chaotic and useless, if I can't make it work I need to arrive at a different solution.

    Thank you

    Brett

    Create works of JS Kit only export animations, all code will be written in java script after export

  • CFIF weird problem with dynamic form variables? Very strange...

    I can't understand what I'm doing wrong here.  Here is my code.  Question explained below.

    < name cfquery = "reviewconfigloader" datasource = "MOLMS" >
    SELECT *.
    FROM dbo. BaseModel
    WHERE the dbo. BaseModel.AccountID = #molmsAccountID # AND.dbo.BaseModel.basemodelActive = 1
    < / cfquery >

    < table width = "100%" border = "0" cellspacing = "0" cellpadding = "3" >
    < cfloop query = "reviewconfigloader" > < cfif AND isdefined("form.baseconfig#reviewconfigloader.basemodelID#") ("form.baseconfig #reviewconfigloader.basemodelID # ') NEQ" "AND (" form.baseconfig #reviewconfigloader.basemodelID # ') QNE 0 > < cfoutput > < tr >
    < td width = "40%" bgcolor = "# F7F7F7" class = "basemodelsub" > #form ['baseconfig #reviewconfigloader.basemodelID #'] # #reviewconfigloader.basemodelName # #reviewconfigloader.basemodelSubName # < table >
    < td width = "15%" bgcolor = "# F7F7F7" class = "basemodelsub" > < div align = "center" > x 14 < / div > < table >
    < td width = "15%" bgcolor = "# F7F7F7" class = "basemodelsub" > < div align = "center" > $486 / year < / div > < table >
    < td width = "15%" bgcolor = "# F7F7F7" class = "basemodelsub" > < div align = "center" > $ 1,444 / year < / div > < table >
    < td width = "15%" bgcolor = "# F7F7F7" class = "basemodelsub" > < div align = "center" > $ 1,444 / 3 yr < / div > < table >
    < /tr > < / cfoutput > < / cfif > < / cfloop >
    < /table >

    What I'm doing here is pretty basic. I'm running a query with a number of configs in it... and then by creating a loop for their output.  Ultimately, I want only the configurations that did not present 0 in the form on the previous page.  Each of the configs in query configuration has a variable of dynamic form on the previous page with a quantity associated with it.  I am trying to remove all the current amounts that are not 0 (or not to eliminate just not see the)... as you can see on the cfif statement.

    This is where it gets weird.  You will notice that I left #form ['baseconfig #reviewconfigloader.basemodelID #'] #, just for the test, which shows me the amount as it should.  I ran a test and put in a couple of 1 s 0 s, 12 s 6 s, etc. in the form fields on the previous page.  If it worked, it would not show anything for the documents with their value by 0 basemodelID.  Not the case.  It shows all the records.  What's funny is that it displays perfectly in my test #form ['baseconfig #reviewconfigloader.basemodelID #'] #, showing good numbers in the previous form, 1, 0, etc., related to each record.  But for some reason, the cfif code isn't catching.

    What's even weirder... I replaced the cfif ("form.baseconfig #reviewconfigloader.basemodelID # ') NEQ 0 with GT 12 (12 has been the largest number I put in shape) and he always showed all the records.  Then I put in as LT 12 and it revealed nothing.  I decided to go one step further and put in to GT 1231243242343 (massive random number), which he always showed all the records.  So, somehow, CFIF statement think that ("form.baseconfig #reviewconfigloader.basemodelID # ') is an incredibly large number, although when I exit in the line below, it is the number, it should be.

    I'm puzzled.  Any ideas?  Thanks in advance!

    Hi Alexander, thank you to try out it... but this errors with error # because just the # emerged from the parenthasis.  So he just bombs.  Let me know if you can imagine than anything else!

    Sorry about that, Jeculture. Christmas factor.

    I unrolled without checking. What he should have said is:

    or

  • HP Pavilion P7-1110: Please help with editing after scanning

    I know how to analyze an element, but after that I scan I do not know how to edit. I have Micro Soft Word 10 and my scanner is a HP Officejet 4630. If you can please help and thank you.

    Hi Tadpolegreen,

    Thank you for answering my questions!

    I would recommend going by there how to scan guide Scan in Windows 7 with full functionality software HP for HP Multifunction printers. Select how to scan with the HP software and how to scan in the form of editable text (OCR), follow the instructions.

    I hope this helps!

  • You can hyperlink a form field name?

    I have a checkbox in a form of ours who wants people to confirm that they have read our partnership agreement. I want to be able to bind the partnership agreement, according to the name of the form field. Here is an example:

    (check box) I have read and agree to your partners services agreement.

    Is this possible?

    I'm not sure, Mike, I tried on my own landing page with the exact code in your screenshot. The editor highlights code in the same way, but it records and works very well.

Maybe you are looking for