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 / April 2006

Tip: Looking for answers? Try searching our database.

Jscript syntax for accessing the value of a field in a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Henry Ong - 06 Apr 2006 23:43 GMT
Hi all, I've been slaving over this for quite a while.

Scenario: I have a form connected to a Data Source(sql server).

Problem: I can't seem to get any values returned from the fields via Jscript.

Not sure if I'm correctly accessing the fields but here's my code:

function
msoxd__Facilities_PurchaseOrderForm_Quantity1_attr::OnAfterChange(eventObj)
{
   
var quantity =
("//dfs:myFields/dfs:dataFields/d:Facilities_PurchaseOrderForm/@Quantity1").text;
   
XDocument.UI.Alert(quantity);
}

I'm not getting any data output to the alert. Any ideas? And thank you in
advance!
S.Y.M. Wong-A-Ton - 07 Apr 2006 09:01 GMT
I'm missing a reference to the Main DOM. You are just listing an XPath
expression here in your code.

Try this:
var quantity =
XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Facilities_PurchaseOrderForm/@Quantity1").text;

---
S.Y.M. Wong-A-Ton

> Hi all, I've been slaving over this for quite a while.
>
[quoted text clipped - 16 lines]
> I'm not getting any data output to the alert. Any ideas? And thank you in
> advance!
 
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.