I have what I believe to be the correct XPath for the above image:
dfs:queryFields/q:tDisc/@Name
I was able to get it using a little trick shown on this blog:
http://egrigg9000.com/mtpub/archives/000064.htmlI still get an error in my script, and I'm not sure why:
Object required
File:script.js
Line:32
My function is incomplete, but here is the code so far:
function CTRL2_8::OnClick(eventObj)
{
// Write your code here
var queryInputString = XDocument.DOM.selectSingleNode("/dfs:queryFields/q:tDisc/@Name").text;
XDocument.UI.Alert(queryInputString);
}
Right now I'm just trying to get the user's input from the form, and show a pop-up window displaying that input. I'll build a SQL statement using the input eventually, but right now I keep on getting the object required error on this line:
XDocument.DOM.selectSingleNode("/dfs:queryFields/q:tDisc/@Name").text;
How can I tell if the problem is with my XPath or with my script?