Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / December 2005

Tip: Looking for answers? Try searching our database.

Script Error "Object Required"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Janie - 04 Dec 2005 16:34 GMT
I have a save event scripted, but I'm getting an error message when I try to
save the form that says "Object Required.  File: script.js  Line 212"  

Here's the section where line 212 occurs - line 212 begins with
"DisplayAccountability.text":

else if (Disp2.text == "")
    {
        DisplayActionItem.text =
XDocument.DOM.selectSingleNode("//my:myFields/my:ActionItem2").text
        DisplayAccountability.text =
XDocument.DOM.selectSingleNode("//my:myFields/my:Accountability2").text
        DisplayDueDate.text =
XDocument.DOM.selectSingleNode("//my:myFields/my:DueDate2").text
        DisplayCompleteDate.text =
XDocument.DOM.selectSingleNode("//my:myFields/my:CompleteDate2").text
        DisplayHowComplete.text =
XDocument.DOM.selectSingleNode("//my:myFields/my:HowComplete2").text
        DisplayNotes.text =
XDocument.DOM.selectSingleNode("//my:myFields/my:Note2").text

What's going on?  The rule is designed so that when one "task" is completed,
the next task due is the one to display.
Franck Dauché - 04 Dec 2005 18:01 GMT
Hi Janie,

Your XPath should start by /my:myFields, not //my:myFields.

Regards,

Franck Dauché

> I have a save event scripted, but I'm getting an error message when I try to
> save the form that says "Object Required.  File: script.js  Line 212"  
[quoted text clipped - 19 lines]
> What's going on?  The rule is designed so that when one "task" is completed,
> the next task due is the one to display.
Janie - 04 Dec 2005 18:31 GMT
I changed all the instances and I'm getting the same error.

> Hi Janie,
>
[quoted text clipped - 27 lines]
> > What's going on?  The rule is designed so that when one "task" is completed,
> > the next task due is the one to display.
Janie - 04 Dec 2005 18:33 GMT
Not sure if my previous message got to you.  I changed all of the instances,
but I'm getting the same error.

> Hi Janie,
>
[quoted text clipped - 27 lines]
> > What's going on?  The rule is designed so that when one "task" is completed,
> > the next task due is the one to display.
Franck Dauché - 04 Dec 2005 19:10 GMT
Try 1 line at a time.  But I am not sure what you are trying to do here.

To access one node, use:
var node = XDocument.DOM.selectSingleNode("/my:myFields/my:ActionItem2");

Note that you are missing the final ";"

You can use XDocument.UI.Alert(node.text); to check that the node exists and
has a value.

Next you can assign that value to a var:
var temp = node.text;

Hope that it helps.

Franck

> Not sure if my previous message got to you.  I changed all of the instances,
> but I'm getting the same error.
[quoted text clipped - 30 lines]
> > > What's going on?  The rule is designed so that when one "task" is completed,
> > > the next task due is the one to display.
Janie - 04 Dec 2005 19:34 GMT
Frank, is there any way to send an attachment of my code to these replies?  
Should there be a semicolon after every var line?

> Try 1 line at a time.  But I am not sure what you are trying to do here.
>
[quoted text clipped - 47 lines]
> > > > What's going on?  The rule is designed so that when one "task" is completed,
> > > > the next task due is the one to display.
Franck Dauché - 04 Dec 2005 19:55 GMT
Nope, but you can send me an email..

Franck

> Frank, is there any way to send an attachment of my code to these replies?  
> Should there be a semicolon after every var line?
[quoted text clipped - 50 lines]
> > > > > What's going on?  The rule is designed so that when one "task" is completed,
> > > > > the next task due is the one to display.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.