How to unselect an item in a multiselect list?

Hi all,
I am displaying a static lov as a multiselect list. And when I select the item in the list, the item is highlighted and I am displaying a region. Now I need to unselect that item and hide the corresponding region. No database transaction is involved. Can anyone please give me some hints?
Rgds,
Suma.

When you use a select list that allows for multiple selections, the "value" attribute is only the first one selected.
For example, if you had 3 options on the list with their "value" attributes set as "A", "B" and "C" and selected A and C, alert(document.getElementById("xxx").value) would display "A" not "A;C".
What you need to do is to loop through each of the options and see if its "selected" value is "true". Something like:
function testForSelected()
var i;
var x = document.getElementById("X");
var o;
for (i = 0; i < x.options.length; i++)
o = x.options;
if (o.value == "A" && o.selected == true)
alert("A is selected");
Where "X" is the multiselect list and "A" is the value of the option item you want to test for. Replace alert(...) with your show/hide function call.
Regards
Andy

Similar Messages

  • How do you delete items from the reading list?

    How do you delete items from the reading list?

    I'm trying to mark your reply as "solved my problem", but I can't see where to mark it. I tried to mark it in the email that came to me with your answer, but it went to a screen that said NOT FOUND. Help?

  • How to show all items in the reading list? I think this option has been removed in Safari Version 7.0.2

    How to show all items in the reading list? I think this option has been removed in Safari Version 7.0.2

    Thanks. That solved it. I had my doubts since I wasn't concerned about my lost bookmarks. I was concerned about the broken functionality. In any event, restoring from a backup solved both the functionality and the lost bookmarks. I appreciate the response!

  • How do I delete item in my purchased list?

    How do I delete item in my purchased list?i dont want to show them what I download.

    You cannot Delete from the Purchased list ... But.. you can Hide...
    Hiding and Unhiding Purchases

  • How do I delete items from my favorites list?

    How do I delete items from my favorites list?

    Hello Kelsey,
    In which App are we speaking of?

  • How to get the selected values from multiselected list

    Hi,
    I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
    This is how it looks:
    P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
    If user chooses 2004 and 2007
    then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
    Any help is appreciated!
    Thanks in advance,
    Sapna.

    Hi,
    I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
    This is how it looks:
    P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
    If user chooses 2004 and 2007
    then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
    Any help is appreciated!
    Thanks in advance,
    Sapna.

  • How to delete an item in the Source List?

    LimeWire arbitrarily entered an item in the source list of iTunes entitled "Buck's LimeWire Tunes". The item is a blue box with a musical note on it. How may I eliminate this box and the files associated with it?

    item is a blue box with a musical note on it. How may
    I eliminate this box and the files associated with it?
    Uninstall Limewire.

  • How do i delete items from the reading list

    how di i delete items from the reading list

    Swipe your finger across the item in the list and a delete button will pop up.

  • How do I remove items from the reading list in safari?

    I have old items on my reading list in Safari.   I can delete unused book marks but how do I remove reading list items?

    Swipe across their name in the reading list and you should get a Delete button appear

  • How do you remove items from the popular list

                   How can I remove unwanted items in the popular list?

    Click here
    and then click Edit in the lower left corner of the window that opens

  • How can I get items in a Reminders List to Sort?

    Nevermind that I'm ****** that Calendar lost it's To Do list, and that Reminders is unusable. How do I change the order of the list of reminders? It pre-sorts itself at random. After about 30 minutes of trying various trackpad/keyboard button combinations I got one item on the list to move. I can'r reproduce it to save my life.
    The one time it worked I pressed my thumb on the trackpad, held down the fn button, and used my index finder to move the list item. Guess it only lets me do that once.

    Nevermind. After more research it is clear that there is currently no way to do this. I'm baffled, but I'll stop trying to do what can't be done.

  • How to display all items titles from custom list with checkbox to select for each user

    Hi All,
    I have a requirement in a sharepoint 2013 development project.
    A custom list items will be created by admin with the following columns:
    Title
    Hyperlink
    User business unit (This column which is a metadata will be a userprofile property)
    In a page/form I have to display the list of titles with a check box based on each user business unit and each user will be allowed to check the list of titles and hit save. And then have to display the list chosen by the user in a webpart.
    If they want to modify their list they have to go to the page/form again and will uncheck the list.
    Am not sure whether I can achieve this through sharepoint out of box feature, I have not done any custom development.
    Please provide your valuable suggestions/ideas on this. Thanks for looking on this !!!

    Hi,                                                             
    Per my knowledge, there are no such OOTB features can meet your requirement, however, there is a workaround that if you can modify your requirement a bit.
    Based on your description, you want different users be able to select values from a list and generate a list own by them.
    If this is what you mean, we can do it like this:
    1. Create another list "Users" which stores the names of every users;
    2. Create a list "Result" which will be available for every user to add their own items, this list will have four Lookup columns and they look up to the "Users" list and the
    list you mentioned before;
    3. Users can add items into "Result" list by selecting the needed values from the other two list, then the items he/she created will be connected to them with the help of the
    Lookup column which looks up to the "Users" list.
    4. You can take use of the OOTB permission management of list to control the access of each item in the "Result" list, and it will be easier for you to manage and filter the
    information you needed.
    The links below about Lookup column for your reference:
    http://office.microsoft.com/en-us/sharepoint-server-help/create-list-relationships-by-using-unique-and-lookup-columns-HA101729901.aspx
    http://www.dummies.com/how-to/content/lookup-columns-in-sharepoint-2010.html
    Best regards
    Patrick Liang
    TechNet Community Support

  • Spark list: how to unselect multiple items programmatically?

    Hi, I have a spark list with multiple selection allowed. I want to add a button next to the list with which to deselect all selected items. How do I go about that? I tried to set myList.selectedItems = null, and myList.selectedItems = new Vector.<Object>, but to no avail. Help would be very much appreciated!

    Hi Sam,
    According to your description, my understanding is that you want to update multiple items in another list when updated a list item.
    In the event receiver, you can update the multiple item using Client Object Model.
    Here is a code snippet for your reference:
    public override void ItemUpdated(SPItemEventProperties properties)
    string siteUrl = "http://sp2013sps/sites/test/";
    ClientContext clientContext = new ClientContext(siteUrl);
    List oList = clientContext.Web.Lists.GetByTitle("another list name");
    ListItem oListItem = oList.GetItemById(1);
    oListItem["Title"] = "Hello World Updated!";
    oListItem.Update();
    clientContext.ExecuteQuery();
    Best regards,<o:p></o:p>
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • How do I remove items from the "favorites" list on the sidebar?

    When I open up a new folder there is a favorite list on the side.  Somehow, random documents and folders appear there.  When I went to the settings I couldn't find how to remove them and when I went to the preferences for finders I saw how to add different icons, but not how to remove these docs/folders from showing up there.  Any suggestions?

    I figured it out.  I read a few of the things on this site and they weren't totally helpful, but messed around and from their suggestions I figured it out!
    Hold Control
    Click on the item you wish to remove
    A list will appear with one of the options being "Remove from Sidebar"
    Click Remove from Sidebar

  • How do I delete items in my Reading list?

    How do I delete pages from my Safari Reading List which is new with ios5?

    Swipe to delete the item from the list. The red Delete button pops up when you swipe.

Maybe you are looking for

  • Software perhaps

    Hi  my blackberry 9300 is acting up.  i've cheacked my charger and battery but it just wont go on. the LED light keeps flashing but nothing more. urgent help needed. any advice? 

  • Showing a window in multiple Spaces

    When I use the equivalent of Spaces in Ubuntu, I can pin a window to the screen so that it appears in multiple Spaces. Can I do this in OS X?

  • Back order rescheduling based on the order date

    Hi, Presently, the back order scheduling is based on the order numbers (A-Z) TO customers. We want it to be by Order date sequence oldest to newest. How can I achieve this? Regards, SS

  • Playback of imported videos

    I am having problem with playback of my videos that have been imported into iMovie. They keep freezing a frame while the music keeps playing and the play button is highlighted. If iclick somewhere else on the time line it starts again but then keeps

  • Missing:  RSDS 2LIS_03_BF   from Content

    When activating from BI_CONT the cube 0IC_C03 some content is missing. It came with the Transformations and DataSources of: RSDS 2LIS_03_BX -> TRCS 2LIS_03_BX_TR But is missing the ones: RSDS 2LIS_03_BF -> TRCS 2LIS_03_BF_TR RSDS 2LIS_03_UM -> TRCS 2