I have a form with a button which is supposed to 1)submit the form to a database and 2) send the form via an email data connection to selected email addresses. My problem is I get an error saying that an object is expected. The error highlights line 77 as the issue. I look at the debugger and can't figure out the issue. I have elements titled 'my:EmailedTo' and 'my:Title' added to my main DOM. Can someone look at the code below and advise what the problem is?
function CTRL196_4::OnClick(eventObj)
{
createEmail();
}
function createEmail()
{
var xmlContributors = XDocument.DOM.selectNodes("dfs:myFields/my:EmailedTo");
var xmlContributor;
var xmlTitle = XDocument.DOM.selectSingleNode("dfs:myFields/my:Title");
var rgRecipients = new Array();
while (xmlContributor = xmlContributors.nextNode())
rgRecipients.push(getNodeValue(xmlContributor.selectSingleNode("dfs:myFields/my:EmailedTo")));
try
{
var oEnvelope = XDocument.View.Window.MailEnvelope;
oEnvelope.Subject = getNodeValue(xmlTitle);
oEnvelope.Visible = true;
}
catch (ex)
{
XDocument.UI.Alert(ex.description);
}
}
Thanks.
Heath