Need a simple code to add days to a date in Infopath 2003 / JavaScript - InfoPath Dev
in

InfoPath Dev

Need a simple code to add days to a date in Infopath 2003 / JavaScript

Last post 03-17-2009 03:44 PM by RhysAZ. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-26-2009 01:52 PM

    Need a simple code to add days to a date in Infopath 2003 / JavaScript

    Hi, Image there are 2 fields to hold 2 dates. What code do I need to write (and where) so that whenever a date/updated is selected in the first field, the second field is automatically populated with the date 2 days after the slected date in the first field. i.e. Second date = first date + 2 days. I need to do this in InfoPath 2003 and Javascript. Thanks!
  • 01-26-2009 09:23 PM In reply to

    Re: Need a simple code to add days to a date in Infopath 2003 / JavaScript

    Hi,

    Add an on after change event to the first date field and write the code as described in the below links.

    http://msdn.microsoft.com/en-us/library/aa239571.aspx

    http://www.infopathdev.com/forums/p/1663/7483.aspx#7483

    Swathip
    www.ggktech.com
  • 02-25-2009 09:38 AM In reply to

    Re: Need a simple code to add days to a date in Infopath 2003 / JavaScript

    Hi there, I am trying to accomplish something similar.  Using IP2003 and have a date picker field in which the user will select a date, then a second date field that I would like to autopopulate with a date 7 days in the future.  I've tried adding the code from the link as you suggested but it doesn't seem to do anything and I'm not sure how to link it so that the code will set the date in the second field.

    Any more help you could offer is greatly appreciated!

  • 03-17-2009 03:44 PM In reply to

    Re: Need a simple code to add days to a date in Infopath 2003 / JavaScript

    Hi- I would like to know this as well. I'm using Infopath 2003. My situation- I have a date picker, which by rules I set, will only allow the user to select a Monday. Now, when they select that Monday, I would like that date to auto populate into a "Monday" text box (or expression box), and then auto populate the "Tuesday" text box (or expression box )next to it, with it's correct date, based off of what was selected for Monday. Basically a [Date], [Date] +1, [Date] +2, etc. I know it can be done easily in IP2007 (but I'm using IP2003) but I'm not sure of the coding or how to enter the coding in IP2003. Please help. Thanks.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.