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 2004

Tip: Looking for answers? Try searching our database.

Date function - total NEWBIE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris D - 20 Dec 2004 19:55 GMT
Hi - I've a date picker called StartDate. I need a textbox to show the day
selected+1.

ie day(StartDate)+1

How do I do that??? Thanks ... Chris
Chris D - 20 Dec 2004 20:29 GMT
Sorry - what I need to be able to do is equivilent to - day(StartDate+1) so
that the text box shows the DayOfTheWeek for the following day.

> Hi - I've a date picker called StartDate. I need a textbox to show the day
> selected+1.
>
> ie day(StartDate)+1
>
> How do I do that??? Thanks ... Chris
Darren Neimke - 20 Dec 2004 20:55 GMT
Chris...

You could handle the OnAfterChange event of your calendar control to grab
the value and calculate the new value like this:

function msoxd_my_field1::OnAfterChange(eventObj)
{
   if (eventObj.IsUndoRedo) { return ; }
   
   var dateField = XDocument.DOM.selectSingleNode('//my:myDateField');
   var textField = XDocument.DOM.selectSingleNode('//my:myTextBoxField');
   
   if( dateField.text ) {
       var tmpDate1 = new Date(dateField.text) ;
       var tmpDate2 = new Date( tmpDate1.getFullYear(),
tmpDate1.getMonth(), tmpDate1.getDate() + 1 ) ;
       
       textField.text = tmpDate2.toDateString() ;
   }
}
 
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.