Adding days to a date in a client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2011 10:47 PM
I have 2 date fields on a catalog item. In one date field, the user can enter or select a date. The other date field I am trying to populate by adding 30 days to the first date field using an onchange catalog client script. So to be clear, if date 1 is 2011-01-01, the onchange clent script for date 1 should populate date 2 by adding 30 days to date 1. In this example then date 2 would be 2011-01-31.
Can someone please instruct me on how to do this. It doesn't seem like it should be that difficult, but I can't figure it out, nor can I find any examples on how to do this.
Any help would be greatly appreciated.
Thank you.
Roger

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2011 04:20 AM
Looks like somebody just came up with a solution for some of the common client-side date problems. You might try this post.
Client Script Date/Time Functions