Form field with comma delimited value list to cfc

I have a form that passes a field to an action page with a
comma delimited value.
For instance the field name is: Program_ID
value for program_ID is: 31, 32
I am able to treat this variable as a list and check its
length, and loop over the list prior to passing it to a cfc using
the attached code:
When I try and pass the variable as a string to a cfc and
invoke a query, cf no longer recognizes my var as a list.
Therefore the code attached does not function...
Is there a specific var type that will pass through as a list
and allow me to run the code block attached?
thanks
Craig

Ok answered my own question.. Here is the answer for those
who are interested...
initialize var for cfc in cfinvoke statement
<cfinvokeargument name="Program_ID"
value="#Form.Program_ID#">
pass argument to cfc as a string
<cfargument name="Program_ID" type="string"
required="true">
use listqualify to parse list in cfc and set new var
<cfset selectedProgramID =
ListQualify(Program_ID,"'",",","CHAR")>
use the new var in the following statement in sql code:
((Program_ID) IN (#PreserveSingleQuotes(selectedProgramID)#))
The following code handles a form field with a single value
or a comma delimited value.

Similar Messages

  • SQL to match a single value in a field with comma-delimited text

    I have a column that can contain none, one or many recordIDs
    (from another table) stored as comma-delimited text strings (i.e.,
    a list). I need to retrieve all records that match a single value
    within that list.
    For example, if I want to match all values that equal
    recordID 3, and I use ... WHERE MyColumn IN ('3') ... , I will get
    all records that have EXACTLY 3 as the value of MyColumn, but not
    any MyColumn records whose values include 3, if they are instances
    such as "3,17" or the like.
    Also using the LIKE operator -- as WHERE MyColumn LIKE '%3%'
    -- will get me unwanted records with values such as 35 or 13 ...
    Can I use some sort of intervening ColdFusion list processing
    to output only the desired records?

    Normalize your database so that your data becomes
    accessible.

  • Displaying data from a list into a single field with comma separated values

    Hi,
    I have a requirement to change a report with an XML structure (simplified version) as below
    <Protocol>
    <ProtocolNumber>100</ProtocolNumber>
    <SiteName>Baxter Building</SiteName>
    <ListOfActivity>
    <Activity>
    <Description>Communication Memo Description.</Description>
    <Name>James</Name>
    </Activity>
    <Activity>
    <Description>Visit 4</Description>
    <Name>James</Name>
    </Activity>
    <ListOfActivity/>
    </Protocol>
    On the report I need to display all the 'Names' for each of the Child (Activities) in a single field at the Parent (Protocol) level, with each Name separated by a comma.
    How do I go about getting this to work?
    Thanks

    Take a look at this: http://blogs.oracle.com/xmlpublisher/entry/inline_grouping
    You could do this (ofcourse, you will need to add extra logic to ensure that there is no comma added after the last name..)
    <?for-each@inlines:Name?><?.?><?', '?><?end for-each?>
    Thanks,
    Bipuser

  • Field with comma separated values to be split into Rows using a Query

    Thanks for the Reply.. I also have to Decode each of the spilt values with some text..
    replace(disc_topics,',',chr(10)) A from XYZ
    Disc_topics values are '01,02,03,04,05'
    this has to be done in SQL
    01 Test1
    02 Test2
    03 Test3
    04 Test4

    select replace( replace( replace( replace( '#' || '01,02,03,04,05,10,11', ',', ',#'), '#0','#'),'#','Test'),',',chr(10)) A from XYZ

  • How to Map Proces form field with Resource form field?

    Hi,
    How to Map Proces form field with Resource form field while creating Process form in Form designer

    Are you talking about Provisioning ?
    then you do that in Data Flow under Process Defintion in OIM 10g
    In OIM 11g you use Request Dataset. In that you can directly map fields to process form.

  • How to populate a hidden form field with a value passed from another page

    I'm using PHP/MySQL and DW CS4.
    I am trying to obtain the external key for a table, and include it as a hidden field in a form for a second table.
    The user selects a "need" from a list and is taken to a new page which displays the need selected in the prior page and a form the user can fill out with details of his offer, there should also be a hidden field in this form that contains the index to the needs table, this hidden field holds the external key. Most of the code is working, except for populating the hidden field with the external key. I have proven(by printing it to the screen) that I have obtained the external key and stored it in a variable ($saveNeedId) . What I'm unable to do is assign this variable to the hidden field in the form I'm about to store in a table. Sometimes I get zero and sometimes I get the index to the first need in the table. This ought to be simple but I can't get it to work, I must be missing something obvious - still very new to PHP.
    Here's the code that sets up the variable and prints it to the screen for test purposes
          $saveNeedId = "-1";
              if (isset($_GET['needId'])) {
                $saveNeedId = $_GET['needId'];
                print $saveNeedId;
    Here's the code that sets up the hidden fields in the form, the one I'm trying to set up is the first one, needId
         <input type="hidden" name="needId" value="<?php echo $row_rsNeedsUnmet['needId']; ?>" />
         <input type="hidden" name="offerId" value="" />
         <input type="hidden" name="MM_insert" value="form1" />
    The page where the user sees the list of needs is here www.hollisterairshow.com/weneed.php
    I'd really appreciate sone help with this, I've tried all combinations of double quotes, percent signs and nothing works...sigh.
    Tony

    Here's the code that sets up the variable and prints it to the screen for test purposes
          $saveNeedId = "-1";
              if (isset($_GET['needId'])) {
                $saveNeedId = $_GET['needId'];
                print $saveNeedId;
    Here's the code that sets up the hidden fields in the form, the one I'm trying to set up is the first one, needId
         <input type="hidden" name="needId" value="<?php echo $row_rsNeedsUnmet['needId']; ?>" />
         <input type="hidden" name="offerId" value="" />
         <input type="hidden" name="MM_insert" value="form1" />
    <input type="hidden" name="needId" value="<?php echo $_GET['needId']; ?>" />
    I looked at your page. It looks like you figured it out.

  • How do I populate form fields depending on the value of a list box?

    Hi,
    Can anybody help me out here?
    I'm creating a form where I'm needing to populate a number of fields (first name & last name) based on the value of a list box (values are 1,2,3,4,5,6) ie: if 3 is selected 3 sets of the first name and last name fields populate on the page for the user to fill out.
    At this stage it is just a prototype site and there is no database running behind it.
    Thanks
    Hayden

    This can only be solved if you have javascript coding skills.  Without knowing more about what you want to do and why, I can only show you a skeleton of how your code should look, but consider this form select field -
    <select onchange="populateForm()">
    When a value is selected from that list, the "onchange" event will fire, and will call the javascript function called populateForm().  You need to define a function by that name somewhere on the page -
    <script type="text/javascript">
    //<![CDATA[
    function populateForm(value) {
         if value >0 { document.getElementById("fieldID").style.display='block' }
         if value >1 { .... }
         etc.
    //]]>
    </script>
    The page itself would need to have ALL the fields already in the form, but with those that are to be revealed set to a style of display:none.
    Obviously, this is a skinny skeleton.  Each test in the function would reveal a new field on the page by changing its display style from "none" (which is how they should be set in the code) to "block".  You would need a separate function for each type of field that might need to be chosen.
    If this is well over your head, then I'm afraid you will be out of luck for this particular approach....

  • FormsCentral - design form : Initialize form field with default value

    Hello,
              My customer asks me to initialize text fields with default values. Example , Name , email , phone number etc to be displayed by default till it is overwritten by values entered. Could you please guide me how to achieve this ?
    Many Thanks,
    Sree

    Hi,
    see Re: sequencing problem-Forms
    Regards Michael

  • List all form fields with JS?

    I imagine this is a pretty easy one, but does anyone know what the script would be to list all form fields in the console?  Specifically, at the moment, I only need it for buttons, but I imagine it would be useful for any fields as well.

    Take a look at the "Required Fields" tool at this site:
    http://www.pdfscripting.com/public/65.cfm
    Its a toolbar button that lists all fields that are required. It could easily be changed to filter for any field parameter, or none.
    Thom Parker
    The source for PDF Scripting Info
    pdfscripting.com
    The Acrobat JavaScript Reference, Use it Early and Often
    http://www.adobe.com/devnet/acrobat/javascript.html
    Then most important JavaScript Development tool in Acrobat
    The Console Window (Video tutorial)
    The Console Window(article)

  • Field with a default value from another field

    I need to populate a field as the default value from another field that the user inputs. I've tried the scripting that I found from the below Topic in the Archived Forums, but I'm not able to make it work. I've tried numerous variations and still to no avail. I tried to make the scripting work in Acrobat 6 and then decided that maybe I needed to upgrade, so I'm now trying it in Acrobat 8 with no results. Can anyone help?
    Topic
    Acrobat 5 - field with default value of another field
    Ben PF - 03:31am Mar 23, 2007 Pacific
    How can I have a field date2 which has the default value of field date1, but which can be edited by the user if necessary without changing the value of date1.
    I've tried, but I just can't figure it out!
    Any help much appreciated.
    Ben
    | Back to Topic List | Bookmark | Subscribe
    To start a NEW discussion click on the Back to Topic List link and select Add Topic.
    If you are in an archive forum please go up to the main topic list (archives are read only).
    Messages
    2 messages. Displaying 1 through 2.
    First Previous Next Last Show All Messages
    Gene Dianoski - 5:22am Mar 23, 07 PST (#1 of 2)
    This, or some variation of this, should work:
    if(this.getField("date2").value == ""{
    this.getField("date2").value = this.getField("date1).value;
    | Bookmark back to top
    Ben PF - 6:49am Mar 23, 07 PST (#2 of 2)
    Thanks very much.
    I put it in at document level to start, but it didn't run the script automatically when date1 was first filled in, so I have put it in as a mouse exit action in date1 and it works a treat.
    Thanks for your help.
    Ben

    Okay forget what I posted above and lets start over. Go to your first field and under Properties -> Actions Tab -> Select Trigger -> On Blur Run A JavaScript.
    Put this:
    this.getField("myField2").value = event.target.value;
    Make sure that you replace ("myField2") with the actual name of your second field. I just tested this and it works for Acrobat version 6.
    I haven't been doing as much javascripting as I used to, so sometimes I too make some basic mistakes.

  • I need to substitute the default font (times roman) in my editable form fields with a san serif...

    I am making a PDF with editable form fields out of InDesign CS6. When I make the interactive PDF, the font, Helvetica Neue  is being substituted with the default font, Times Roman. The client has provided me with last years PDF which has a nice San Serif for the editable fields. I need to change the font either to Helvetica Neue, or at least to a nice San Serif common system font. I have Acrobat X.
    Thanks in advance!!

    I called a friend of mine who walked me through this so I will post the instructions for anyone else who may be having this problem...
    1. Open the PDF with the form fields in a recent version of Acrobat.
    2. Click on the Toolls tab.
    3. Under Forms, click Edit.
    4. Now you will see your fields listed under "Field" > "Sort by"...  "Text Field 1"...  etc.
    5. Holding "control" click where it says "Text Field 1" and some options will pop up.
    6. Click on "Properties".
    7. A "Text Fields Properties" window will pop up.
    8. Click on the "Appearance" tab.
    9. Here you can change your fonts and font sizes.
    Good luck!

  • How to count ONLY fields with a specific value

    I modified the code below from the API reference to count combobox fields with a value of "MT" so I could total the number of a specific choice the form user input.
    var count = 0;
    for (var i=0; i<this.numFields; i++)
    var fname = this.getNthFieldName(i);
    if ( this.getField(fname).type == "combobox" && this.getField(fname).value == "MT" ) count++;
    this.getField("mTurb").value = count.value;
    Here's the problem: I tried to use a similar script, modified only slightly from this form, in another total field to tally a different choice made with comboboxes and the script continues to tally the first choice. An example of one of the modified versions of the script is below.
    var gcount = 0;
    for (var i=0; i<this.numFields; i++)
    var gname = this.getNthFieldName(i);
    if ( this.getField(gname).type == "combobox" && this.getField(gname).value == "MT" ) gcount++;
    this.getField("gPack").value = gcount.value;
    I suspect I'm just missing something painfully obvious to seasoned scripters, but I can't seem to figure it out and I need this script to be able to count the number of 9 different options in the comboboxes.

    OK, you can use a script like the following as the custom calculate script for the text fields that perform the counts:
    // Custom calculate script for text field
    (function () {
        // Declare and initialize variables
        var fn, s = "MT", count = 0;
        // Loop through the combo boxes
        for (var i = 1; i < 25; i++) {
            // Determine the current field name
            fn = "M" + util.printf("%02d", i));
            // See if the field value matches
            if (getField(fn).valueAsString === s) count++
        // Set this field value to the count
        event.value = count;
    Change the value of the "s" variable to match the item that you want to count. The first and last lines prevent the unnecessary creatio of global variables, which is good. It also makes it easy to transfer to a more general document-level routine, which would be event better, something like:
    // Custom calculate script for text field
    function getCBCount(s) {
        var fn, count = 0;
        // Loop through the combo boxes
        for (var i = 1; i < 25; i++) {
            // Determine the current field name
            fn = "M" + util.printf("%02d", i));
            // See if the field value matches
            if (getField(fn).valueAsString === s) count++
        // Set this field value to the count
        event.value = count;
    You would then call this function from the individual text boxes with the following custom calculate script:
    getCBCount("MT");
    and replace "MT" with the vlaue you want to count.

  • Help...  Populate pdf form fields with html form inputs.

    I have a website that allows users to choose the pdf document they want and create. After selecting which pdf they want to create they are redirected to a web page with a html form. The html form has questions that corresponds with the the form fields of the pdf document the user selected. When submitted the code (ASP, PHP whatever is the easier) runs a script that populates the pdf document form fields. The user is then prompted if they want to save or open the document. The newly created pdfs and the user inputs do not need to be saved on the server.
    I create the pdf templates using PDF 6.0 professional
    Server can be windows or linux
    I understand ASP a little but will use whatever is feasible
    Purchasing a program is okay as long as its reasonable and is changeable by me and I have full control.
    Any help would be appreciated...
    Thanks,
    John

    Try the Developers/SDK forum...
    This forum is for questions about the PDF Language itself.
    Leonard

  • How to map the form fields with zoho crm module?

    I am integrating a web app with Zoho CRM,I created a form in .aspx and put some fields on it like first name,last name,email etc.Now i want to map these fields with the zoho crm contacts module,so that when i submit this form it will save the data there.
    Sumit Bhargav

    Hi Sumit,
    ZOHO CRM is third party software, it’s out of our support range. I recommend you have a look at ZOHO Developer API from
    http://www.zoho.com/crm/help/api/. If you have any questions about it, you can open thread on their forum for support.
    https://forums.zoho.com/.
    Thank you for understanding.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to populate 2 screen-fields with one [ON VALUE-REQUEST FOR input] evnt?

    I have a selection screen with 2 text inputs - input1, input2.
    For the first one I have an "AT SELECTION-SCREEN ON VALUE-REQUEST FOR input1" event.
    I successfully get a value there and that is set to the screen field. But I also want input2 to be automatically populated with a value corresponding to the selected input1 (eg. input1=ID, input2=Name).
    I'm able to set input2 ABAP variable but not the screen-element.
    (I guess that ON VALUE-REQUEST doesn't fire any events for screen fields update, because if I press ENTER after using my search-help, then input2 is set with the right value)
    How to solve the problem?

    Hi Ramchander,
    Actually I used FM F4IF_FIELD_VALUE_REQUEST which doesn't have mapping parameters.
    But after your advice I looked through F4IF_INT_TABLE_VALUES_REQUEST and found that it's
    DYNP_VALUES_UPDATE FM that solves my task.
    Thanks!

Maybe you are looking for