I am receiving the following error:
"InfoPath cannot open the selected form because of an error in the form's code.
The following error occurred:
Expected ';'
File:script.js
Line:24
string txtPath;"
Any idea why this would be happening?
Here is the entire code:
function CTRL2_5::OnClick(eventObj)
{
string txtPath;
string txtName;
string GMSRef;
GMSRef = XDocument.DOM.selectSingleNode("my:myFields/my:field2").text;
txtPath = "Z:\My Documents\InfoPath Forms\";
txtName = ".xml";
XDocument.SaveAs(txtpath & GMSRef & txtName);
thisXDocument.Application.Close(true);
}
I had received help in converting from VBScript to JScript in this thread:
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=4558