I have a JS function as below
// A simple array where we keep track of things that are filed.
filed = [];
function fileIt(thing) {
// Dynamically call the file method of whatever 'thing' was passed in.
thing.file();
// Mark as filed
filed.push(thing);
}
Now, function fileIt(thing)
is working well when called as below
fileIt(AuditForm);
Whereas, its giving error at line thing.file();
when i am trying to pass a variable like below
var formID = obj.id;
fileIt(formID);
Variable formID
has same value and i.e. "AuditForm" what's wrong here. Kindly suggest.