Selecting items in a list from a multivalue field

I have an edit page that includes a menu form element that
allows multiple selections. It inserts all the IDs from a table
that it's got from a recordset as a string into field named
EventType separated by commas ("10000,10002,10004"). So far so
good.
I have a dynamic menu behaviour on the edit page too but when
I reload it none of the options in the list are selected. It will
mark an item in the menu as selected when there's only one value,
presumably because when there are multiples the behaviour is trying
to match a string of "10000,10002,10004" to the values in the the
list , which are separate values:
<select name="EventType" size="5" multiple="multiple"
id="EventType">
<option value="10001" >Abseil</option>
<option value="10007" >Golf</option>
<option value="10000" >Marathon/Run</option>
<option value="10008" >Other outdoor</option>
<option value="10003" >Overseas</option>
<option value="10005" >Social</option>
<option value="10006" >Triathlon</option>
<option value="10004" >Walking</option>
I'd have thought this would have been dealt with by the
behaviour, but apparently not. How to I break apart the multivalue
field to select each item in the menu?

Thank you for poitning me in the right direction. I was being
a little slow today:
While (NOT rsEventType.EOF)
%><option
value="<%=(rsEventType.Fields.Item("ID").Value)%>" <%
Array = Split(rsEvent.Fields.Item("Type").Value,", ")
For Each i In Array
If rsEventType.Fields.Item("ID").Value = i Then
response.write "selected"
End If
Next
%>><%=(rsEventType.Fields.Item("EventType").Value)%></option>
<%
rsEventType.MoveNext()
Wend

Similar Messages

  • Populate drop-down list from multiple text fields.

    Just to begin, I am brand new to this application and brand new to coding in general. Anyways, this is what I am trying to accomplish. I need to populate a drop-down list from multiple text fields. I am able to populate one item using this in the calculate event:
    TextField1.rawValue
    After I type text in TextField1 and hit enter, it displays the text in the drop-down list. I need to do this but with more than just one text field to populate more options for the drop-down list. I will also need to do something similar with populating a drop-down list from selections made in multiple other drop-down lists.
    Thanks for any help you can give me.

    Thank you for your suggestion Geo Kaiser. With that, I was able to populate my drop-down lists, but now when I select an option from the drop-down list, the selection dissapears. The selection will appear briefly in the box but then dissapears although my drop-down list options remain there. Here is the code I am using for my text field to drop-down list:
    DropDownList1.clearItems()
    DropDownList1.addItem(TextField1)
    DropDownList1.addItem(TextField2)
    And here is my code for my drop-down list to populate another drop-down list:
    DropDownList3.clearItems()
    DropDownList3.addItem(DropDownList1)
    DropDownList3.additem(DropDownList2)
    Thanks again for your help. By the way, I am using Adobe Designer 7.0.

  • ADD ITEMS TO DROPDOWN BOX FROM A TEXT FIELD(USER ENTERS THE ITEM) AND BOUND VALUE ALSO

    I WANT TO ADD ITEMS  THE DROPDOWN BOX FROM THE TEXT FIELD(ITEM NAME) WHERE USER ENTER'S THE ITEM DESCRIPTION
    AND BOUND VALUE ALSO SHOULD BE ADDED TO THE SAME ITEM.
    SAME WAY REMOVE ITEMS FROM DROPDOWN BOX
    PLEASE GIVE SAMPLE FORM OR JAVASCRIPT FOR THE ABOVE SCENARIO.....
    INDEED HELPFUL FOR MY PROJECT PLEASE SEND ATTACHED PDF FORM

    Hi Praveen,
    Your form is not shared so I have not been able to access it.  But I have updated mine.  There are now two approaches, one that follows on from the above method and updates each drop down list in each row.  The second updates a separate dataset that the drop down list is bound to.  This second approach requires the remerge() method which can cause problems if your code has updates some form properties like a borders color as these will be reset, but the code is simplier and you will only have one list to maintain.  The add button click code is;
    var particulars = xfa.datasets.resolveNode("particulars");
    if (particulars === null)
        particulars = xfa.datasets.createNode("dataGroup","particulars");
        xfa.datasets.nodes.append(particulars);    
    var particular = xfa.datasets.createNode("dataValue","particular");
    particular.value = ItemName.rawValue;
    var boundValue = xfa.datasets.createNode("dataValue","id");
    boundValue.value = BoundValue.rawValue;
    particular.nodes.append(boundValue);
    boundValue.contains = "metaData";
    // find sorted position to insert
    for (var i = 0; i < particulars.nodes.length; i++)
        p = particulars.nodes.item(i);
        if (p.value > particular.value)
          particulars.nodes.insert(particular, p);       
                 break;
    // add to end if greater than all existing items
    if (particular.parent === null)
        particulars.nodes.append(particular);
    // clear source fields
    ItemName.rawValue = null;
    BoundValue.rawValue = null;
    // remerge form data to pick up new item
    xfa.form.remerge();
    And the binding looks like;
    I have updated my sample to include both methods, https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g
    Regards
    Bruce

  • Second list of items from selected item in first list

    Hi all,
    I have 2 dropdown lists in my jsp page. i am retrieving data from database for my first list box. the second list box data should be displayed when user select an item from the first list. the selected item from first list is necessary to get another list of items in second list. i dont want to use any buttons or submits. i want to redirect the data to the same page to get another list when user click one option from first list. Thanks in advance for any suggestion.

    use ajax or store the data in javascript array

  • Display selected items in dynamic list box

    I need to display the selected items in a dynamic list box -
    this worked great - but now client wants multiple selected. I do
    have the items comma delimited in single field (but I can change
    that if I need to) - so how do I make those items display as
    selected in list. I'm using asp and standard dreamweaver list based
    on a recordset.

    There is a better approach. I faced a similar problem and put all the logic in a Javascript function. I modified my code to suit your needs.
    My HTML will have the following.
    <body onLoad="javascript:initLanguages();">
      <form name="languageForm">
        <select size="1" name="languagesList">
        </select>
      </form>
    </body>I created a Javascript function
    <script language="Javascript">
      //-- put all your languages here in a Javascript Array if they are fixed.
      //-- If you get the langauges from a Java object (dynamic or configurable), generate the Javascript in that object and insert a scriptlet in the HTML that plugs in the generated Javascript into this HTML. If so, take care of the quotes and double quotes. They are tricky !!!
      var languageArray = new Array("Fran?ais", "English", "Espanol", "Deutsch", "Italiano");
      function initLanguages ()
        var listCounter = 0;
        for (var ind=0; languageArray != null && ind < languageArray.length; ++ind)
          var obj = eval("new Option" + languageArray[ind]);
          eval("document.languagesForm.languagesList.options[listCounter]=" + "new Option" + languageArray[ind]);
          if(document.languagesForm.languagesList.options[listCounter].value == "<%= selectedLanguage %>")
            document.languagesForm.languagesList.options[listCounter].selected = true;
          listCounter += 1;
    </script>
    selectedLanguage is something you get in the Java code
    <%
      selectedLanguage = myObj.getSelectedLanguage();
    %>

  • How to move to the next Selected Item in a list.

    *Edited*
    I was just wondering how I could make a button which would move the currently selected item to the next in the array loaded into a List component. I would think to do it through AS or an event, but I'm not sure what I would reference in accordance to that component. The help would be appreciated, thank you.

    You can set the selectedIndex. When next button is clicked increment the selectedIndex.
    If( list.selectedIndex < list.dataProvider.length - 1 )
         list.selectedIndex++;

  • Selecting items in column/list view copying them and pasting them to

    in the past (was it OS 9 ?????? ) i would be able to select all items in a folder
    if i had a long list of titles of files ( songs ) and copy to clipboard and then paste them to text edit and have that list handy for future reference. for example if i have a DVD with 100 photos. I want to keep a file of the names only. I used to be able to select all of them copy and then paste to a document. Cant do it in TIGER????? am i wrong?
    work arounds....

    Hi, Glenn.
    How this works now appears to depend on the application into which you are pasting the results.
    If I open a folder, Select All (Command-A), Copy (Command-C), and then paste into a TextEdit document, if the contents include PDFs it actually pastes all the PDFs into the document! Looks like a change in how this works.
    If I paste into a Carbonized text editor, like Tex-Edit Plus, it pastes the file names, as expected.
    Here's a workaround:
    1. Open the Macintosh HD > Applications > Utilities folder and Lunch Printer Setup Utility. You should see a printer icon in your Dock.
    2. Drag and drop the folder whose contents you want to save a listing of to the icon in the Dock.
    3. When the Print window displays, either:• Click Preview. A print preview of the FInder info for those files appears in Preview. If you like what you see, select File > Save As... and save the output.
    • Click the PDF pop-up button and select "Save as PDF" from the list. Follow the prompts from there to save the Finder info as a PDF file.The resulting PDF saves the list you desired.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Selected Item in a list automatically scrolled to the top

    Hi All,
    I am having a tough time solving this problem. Please help.
    In my application I have a list keeping track of all the
    games currently going on. The list keeps getting updated regularly.
    What is happening is that whenever I select an item by clicking on
    it, in the next update it automatically
    gets scrolled to the top. This does not get removed even if I
    click anywhere on the stage.
    Because of this I am not able to scroll my list properly.
    Every few seconds, it goes to the top and I am not able to scroll.
    Please help. Any suggestions are welcome.
    With Regards,
    Rohit Sharma

    Ok,
    try this:
    every time BEFORE your page get updated
    you first save the verticalScrollPosition
    var p1:int = list.verticalScrollPosition;
    then AFTER your page get updated you set the value back
    list.verticalScrollPosition = p1;

  • Help with SELECT to get a total from a database field? ASP/VBScript

    I have two tables, Events and Orders. The Events table:
    eventID
    title
    ticketsavailable
    The Orders table:
    orderID
    customerID
    eventID
    numberofticketspurchased
    I want to be able to calculate the total number of tickets
    purchased by all
    customers.
    I'd managed to vind out the total number of orders, for any
    one event, by
    doing the following:
    (SELECT COUNT(*) FROM dbo.orders WHERE dbo.events.eventID =
    dbo.orders.eventID) AS numberoforders
    ...I wondered if there was something similar, to give me the
    total number of
    tickets purchased? Thanks.
    Regards
    Nathon

    tradmusic.com wrote:
    > "Dooza" <[email protected]> wrote in message
    > news:[email protected]...
    >> tradmusic.com wrote:
    >>> "Dooza" <[email protected]> wrote in
    message
    >>> news:[email protected]...
    >>>> tradmusic.com wrote:
    >>>>> Also, this will only return events that
    have sold tickets right?
    >>>>> Ideally I'd like to show all events, but
    I guess if they are linked by
    >>>>> eventID, I'm kinda stuck?
    >>>> What exactly do you want the output to look
    like?
    >>>>
    >>>> Steve
    >>> I wanted to view a list of all of the events,
    with a column that showed
    >>> the number of tickets left.
    >>>
    >>> In my events table, I have a "tickets available"
    column, which is the
    >>> original stock number. In my output, I basically
    wanted to perform a
    >>> calculation that would subtract the SUM column
    value from the tickets
    >>> available column, giving me the number of
    tickets left in stock.
    >>>
    >>> Thanks again.
    >>> Nathon.
    >> Ok, so you want:
    >>
    >> 1. Event
    >> 2. Tickets Sold (SUM)
    >> 3. Tickets Available
    >> 4. Tickets Remaining
    >>
    >> Grouped by Event.
    >>
    >> SELECT dbo.events.eventtitle,
    SUM(dbo.webordersitems.ticketquantity)
    >> AS ticketsSold, dbo.events.ticketsavailable,
    >> (dbo.events.ticketsavailable -
    (SUM(dbo.webordersitems.ticketquantity)))
    >> AS ticketsRemaining
    >> FROM dbo.events JOIN dbo.webordersitems ON
    dbo.events.bookeventID =
    >> dbo.webordersitems.bookeventID
    >> GROUP BY dbo.events.eventtitle
    >>
    >> Steve
    >
    > Thanks Steve, that's really helpful.
    > This is still only going to show events that have had a
    sale though, right?
    >
    > I guess I could just create two recordsets on my page,
    one for events that
    > have had sales, and one for the remaining events.
    > My understanding is that, because we are running a JOIN
    by bookeventID, it
    > wouldn't actually be possible to display all events
    because, by the very
    > nature of the statement, the bookeventID has to appear
    in the webordersitems
    > table, indicating that a sale had taken place.
    >
    > Much appreciated. Thanks again.
    Hi Nathan, I think its the combination of the JOIN and the
    GROUP BY
    which is preventing you from getting exactly what you want.
    If you look
    up JOINS you will find one called an OUTER JOIN, that will
    help, but due
    to the GROUP BY it will fail, so I think for the moment your
    best bet is
    2 recordsets.
    Steve

  • Updating/ Creating items in a list Identified by 2 fields

    Hey guys,
    So I have this points list, and it updates points based on items created and modified in other lists. The identifier has always just been a username. I want to modify this points list to be sorted by date and user. So
    basically when an item is created or updated in another list I want it to be able to check if an item exists in this list by username and date, then either update the list item or create a new item based on username and date. Is this even possible?
    Currently I'm checking for username in a list by assigning a workflow variable to the lookup of the username and if it is empty it does not exist. I could do this for both username and date, but I'm not sure how I could
    update an item based on both.

    Thanks for the replies,
    One more problem. I fill the user column when the points are going to be calculated. So it fills the user column and then checks for the calculated column (calculated partially off of the user column). It fails to wait
    for the calculated column to finish, so i put a wait on the calculated column to begin with user, but the workflow gets stuck on that pause. I tried even waiting till the user column was filled, but it still doesn't receive the correct calculated column (as
    if i didn't even have a pause). If I manually enter in the user it works as it should. 
    how can i fix this?

  • Query to select value for max date from a varchar field containing year and month

    I'm having trouble selecting a value from a table that contain a varchar column in YYYY-MM format. 
    ex.
    Emp_id Date Cost
    10264 2013-01 5.00
    33644 2013-12 84.00
    10264 2013-02 12.00
    33644 2012-01 680.0
    59842 2014-05 57.00
    In the sample data above, I would like to be able to select the for each Emp_id by the max date. Ex. For Emp_id 10264, the cost should be 12.00.

    create table test (Emp_id int, Date varchar(10), Cost decimal (6,2))
    insert into test values(
    10264, '2013-01', 5.00 ),
    (33644, '2013-12', 84.00 ),
    (10264, '2013-02', 12.00 ),
    (33644, '2012-01', 680.0 ),
    (59842, '2014-05', 57.00 )
    Select Emp_id,[Date],Cost FROM (
    select *,row_number() Over(Partition by Emp_id Order by Cast([Date]+'-1' as Datetime) Desc) rn
    from test)
    t
    WHERE rn=1
    drop table test

  • Using checkboxes to select items in a Spark DataGroup/List?

    I have a DataGroup from Catalyst, laid out like a tile list:
    I'd like to do something a bit different, in that I'd like to allow people to multi-select items in the list using those checkboxes instead of the usual command/control-click.
    The checkbox, label and image are in the itemRenderer.  Is there an easy way that I can have that checkbox toggle the selected state of its list item?

    Hi,
    Using the checkbox as a selection is easy enough as all you have to do is add a change event to the checkbox in the renderer and then in the event
    selected=mycheckbox.selected;
    The fun is how to handle the list click event from the checkbox you can stop propagation but if the item is clicked it will reset the selected indices.
    There is a few ways to handle this
    when processing the list don't use the selected indices just use the checkbox value to determine whats selected
    disable the listbox click event so items have to be selected with the checkbox
    or the most complex lots of overriding so that click acts like a ctrl/click and the checkbox/itemclick can toggle each other.
    David

  • Passing Multiple Selected List Items to a "New Item" Form in Another List with Multiselect Lookup Field

    Hi!
    Version Info:  SharePoint 2013 Server Standard (*BTW...I do not have access to Visual Studio*)
    I have two lists, let's call them
    -Assets
    -Asset Checkouts
    "Assets" is the parent list, and "Asset Checkouts" has a lookup column (multiselect) which is tied to the serial # column in the "Assets" list.
    Basically, what I need to accomplish is this:  I would like to be able to select multiple list items in the "Assets" list, and create a new item in "Asset Checkouts", and pre-fill the multiselect lookup column in the NewItem form
    for "Asset Checkouts" with the values from the selected items in "Assets".
    Any ideas or suggestions on how to do this would be most appreciated!
    Thanks!

    Hi,     
    According your description, you might want to add new item in "Asset Checkouts" list when selecting items in "Assets" list.
    If so, we can achieve it with SharePoint Client Object Model.
    We can add a button in the "Assets" list form page, when selecting items, we can take down the values of columns of the selected items, then click this button which will create
    new item in "Asset Checkouts" list with the values needed.
    Here are some links will provide more information about how to achieve it:
    Use
    SP.ListOperation.Selection.getSelectedItems() Method to get the list items being selected
    http://msdn.microsoft.com/en-us/library/ff409526(v=office.14).aspx
    How to: Create, Update, and Delete List Items Using JavaScript
    http://msdn.microsoft.com/en-us/library/office/hh185011(v=office.14).aspx
    Add ListItem with Lookup Field using Client Object Model (ECMA)
    http://notuserfriendly.wordpress.com/2013/03/14/add-listitem-with-lookup-field-using-client-object-model-ecma/
    Or if you just want to refer to the other columns in "Assets" list when add new item in "Asset Checkouts" list, we can insert the "Assets" list web part into the NewForm page
    of the "Asset Checkouts" list, then when we add new item in the "Asset Checkouts" list, we will be able to look through the "Assets" list before we select values for the Lookup column.
    To add web part into the NewForm.aspx, we need to find the button "Default New Form" from ribbon under "List" tab, then we can add web part in the NewForm.aspx.
    In the ribbon, click the button “Default New Form”:
    Then we can add web part into NewForm.aspx:
    Best regards
    Patrick Liang
    TechNet Community Support

  • Get Selected Items from ListBox

    Hi,
    How do I get the Selected items of a List in Flex.
    I am using a multi-select List.
    Thx

    Never mind..I got it.
    it as simple as that:
    Alert.show (lst.selectedItem.fieldname);
    ;)

  • Using value of selected item list

    I'm working on existing code. I want to use the value of a selected item in a list to use it in a query. So, the corresponding records should be displayed in a subform when an item of the list is selected. This is the code i'm using:
    This is the code i use to populate the list
    DECLARE
    locatienaam varchar(100);
    locid number;
    recordcount number;
    i number;
    correct NUMBER;
    hList ITEM := Find_Item('LIST_LOCATIE');
    iRC PLS_INTEGER := 0;
    currValue VARCHAR2(60); /* increase if required*/
    BEGIN
    --vraag het bijhorende ID op van de geselecteerde locatie.
    currValue := Name_In('LIST_LOCATIE');
    FOR i IN 1..Get_List_Element_Count(hList) LOOP
    IF currValue = Get_List_Element_Value(hList,i) THEN
    iRC := i;
    break;
    END IF;
    END LOOP;
    locid := GET_LIST_ELEMENT_VALUE('LIST_LOCATIE', iRC);
    locatienaam := GET_LIST_ELEMENT_LABEL('LIST_LOCATIE', iRC);
    Below the code i use to make the query
    SET_BLOCK_PROPERTY('V_KALENDER',DEFAULT_WHERE,'(BEGINDATUM BETWEEN '||''''||:V_KALENDER.TIJDSTIP1 ||'''AND '||''''||:V_KALENDER.TIJDSTIP2||''') AND (NAAM=:locatienaam)');
    GO_BLOCK('V_KALENDER');
    Execute_Query;
    I get the message: "unable to resolve reference to locatienaam"
    The subform is populated with all the records between the two dates of all the locations, not only by the selected location.

    Hi,
    Welcome to the forum!
    If locatienaam is a local variable, don't use a colon (:) to reference it.
    You didn't say
    IF :currValue = Get_List_Element_Value(:hList,:i) THEN so why should you say
    :locatienaam?

Maybe you are looking for

  • Facebook and twitter

    Hi admin,I did upgrading to facebook and twitter applications on my blackberry 9800 tourch,since then I can use them cus I keep having this message uncaught exception,I can see that of facebook icon and that of twitter is no where to be found.what is

  • E mail links in Emails don't work?

    I set up an email newsletter in DW,and while the weblinks worked fine, the email link works great in DW preview but not at all upon receiving the actual test e mail. Is this not doable? thanks.

  • WD Abap - Internet Explorer (File:new Window)

    hi folks, is it possible to prevent wd abap applications to get started more than once by one user (using File->New->Window in internext explorer?), because we're encountering a lot of problems by doing that? kind regards oliver

  • Help with silly little web page pls

    I've made a little web page for som kids in my neighborhood. Problem: PNG-8 image, w/alpha transparency, shows up fine when I preview in my browser (Firefox 3.0.10). - however - Image shows 'white' where it is supposed to be transparent when I view t

  • Macro to Unlock the Cell on the start day of the Fiscal period

    Dear Experts We are using  fiscal periods for the forecasting.1 period = 15 days.We forecast for 24 fiscal periods. We only give chance to some customers to update forecast on  1 day of the fiscal period in the customer planning book .In this regard