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