> In designing a form I have a Date Picker field to choose Date Received.
> I would like to create a field which would Auto insert a date that is Date
[quoted text clipped - 3 lines]
> Thank you,
> Luke Slotwinski
Wong-A-Ton:
I am in InfoPath 2003... I searched the newsgroup but could not find exactly
what im looking for. I found
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.infopath&mid=8eb30843-25b5-4da3-a3f3-1e08183237b7&sloc=en-us
; which is close to what I need. I have a field rcv_date and want the next
field due_date to be +10 days from rcv_date. The examples listed under the
two URL's you posted to that reply do not show how to link it to another
field. If I create the function..
function addtendays()
{
dtNextWeek = new Date();
dtNextWeek.setDate( dtNextWeek.getDate()+10 );
alert( dtNextWeek );
}
Where do I put this function? And how can I get it to bind to due_date field?
Luke Slotwinski
> If you are using InfoPath 2007, you can use the built-in "addDays" function
> to do this. If you're using InfoPath 2003, you'll have to code it yourself.
[quoted text clipped - 9 lines]
> > Thank you,
> > Luke Slotwinski
Russ - 07 Nov 2006 21:01 GMT
You can call that function from within the OnAfterChange event handler for
the rcv_date field. Add the OnAfterChange event handler by locating the
field in your form's data source, double click, select "validation and event
handlers" tab, select OnAfterChange from the events box, click edit.
Then you'll need to update the due_date field with the new date, which you
can do:
xmlDueDate = XDocument.DOM.selectSingleNode(xpath to due_date)
xmlDueDate.text = dtNextWeek
Something like that should work.
> Wong-A-Ton:
> I am in InfoPath 2003... I searched the newsgroup but could not find exactly
[quoted text clipped - 29 lines]
> > > Thank you,
> > > Luke Slotwinski