Multiple Selection List box - InfoPath Dev
in

InfoPath Dev

Multiple Selection List box

Last post 03-20-2007 03:58 PM by Matt Faus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-09-2007 03:46 PM

    Multiple Selection List box

    I have a form that has some multiple selection list boxes and I'm having trouble capturing the selected values. For each selected value in the multiple selection list box I need to get the value of each selected value and email it in a plain text email.

    I'm currently am able to send an email with all of the items in the list using:

    function XDocument::OnSubmitRequest(eventObj)
    { var iMsg = new ActiveXObject("CDO.Message");
    iMsg.To = "[email protected]";
    iMsg.From = XDocument.DOM.selectSingleNode("//my:email").text;
    iMsg.Subject = XDocument.DOM.selectSingleNode("//my:textbox1").text +
    " - " + XDocument.DOM.selectSingleNode("//my:Subject").text;
    var objDOM = XDocument.GetDOM("List from Sharepoint list");
    objDOM.setProperty("SelectionNamespaces", 'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" ' + 'xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"');
    //Get the selected items
    var objProblemItems = objDOM.selectNodes("/dfs:myFields/dfs:dataFields/dfs:StoreRepairsList/@CatagoryFromList");

    for(i=0;i<=objProblemItems.length-1;i++)
    {
    iMsg.TextBody += objProblemItems(i).text;
    if(i<objProblemItems.length-1)
    {
    iMsg.TextBody += ",";
    }
    }


    How can I just get the selected items in the list, instead of all items?

    Any help is appreciated.

    Thanks,
    Jared
  • 03-20-2007 03:58 PM In reply to

    Re: Multiple Selection List box

    Hi Jared,

    I'm not sure on your schema, but you should probably change this line:

    var objProblemItems = objDOM.selectNodes("/dfs:myFields/dfs:dataFields/dfs:StoreRepairsList/@CatagoryFromList");

    to something like this:

    var objProblemItems = objDOM.selectNodes("/dfs:myFields/dfs:dataFields/dfs:StoreRepairsList[@Selected = 'true']/@CatagoryFromList");
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.