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 / March 2005

Tip: Looking for answers? Try searching our database.

problem updating date field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephan Steiner - 21 Mar 2005 10:29 GMT
Hi

I have two datepickers in a form, and upon making a choice in one, I'd like
to automatically update the other (for instance, user choses a start date,
so the end date will automatically be set to start + 1 month).

Here is my OnValidate method

var date1 = XDocument.DOM.selectSingleNode("/dfs:myFields/my:start");
var date2 = XDocument.DOM.selectSingleNode("/dfs:myFields/my:end");
date1.nodeTypedValue = date2.nodeTypedValue;

At the 3rd line, I get an "InfoPath cannot update the data because the form
is currently read only" error and I cannot explain that error. After all,
neither start nor end have been set to be read only. Also, for some wicked
reason, if I look at date1.nodeTypedValue, or date1.text, both are empty
strings even though a value is set in the datepicker. How can I get the date
set?

Any ideas?

Stephan
Greg Collins [InfoPath MVP] - 21 Mar 2005 21:00 GMT
The form IS read-only for OnBeforeChange and for OnValidate. You must use the OnAfterChange event if you want to make changes to the DOM.

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

Hi

I have two datepickers in a form, and upon making a choice in one, I'd like
to automatically update the other (for instance, user choses a start date,
so the end date will automatically be set to start + 1 month).

Here is my OnValidate method

var date1 = XDocument.DOM.selectSingleNode("/dfs:myFields/my:start");
var date2 = XDocument.DOM.selectSingleNode("/dfs:myFields/my:end");
date1.nodeTypedValue = date2.nodeTypedValue;

At the 3rd line, I get an "InfoPath cannot update the data because the form
is currently read only" error and I cannot explain that error. After all,
neither start nor end have been set to be read only. Also, for some wicked
reason, if I look at date1.nodeTypedValue, or date1.text, both are empty
strings even though a value is set in the datepicker. How can I get the date
set?

Any ideas?

Stephan
 
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.