views:

3

answers:

1

I've been using Xin Calendar for a few years in my forms to allow users to click-enter dates.

Site: http://www.yxscripts.com/xc2/index.html

The issue I'm having is I want to have the user select the first date, then after it's selected, automatically set the end date 3 months in advance if the end date is null.

I can figure out the JS part, but I can't get the function to call after they've clicked the cal icon that selects the first date. I've tried to use "onchange" but it doesn't get triggered by the change from the calendar, only when changed from typing.

I'm trying to RTFM, but I'm not getting it. Hoping someone else has used this script and can help.

TIA.

A: 

Figures... I spent a couple of hours banging my head trying to figure it out, then right after I post, the lightbulb went off.

Here's a solution to get you started if you ever need it.

Up in the tags add the following below the references to the .js files needed for xin calendar:

<script language="javascript">
  function afterSetDateValue(ref_field, target_field, date) {
    alert("rf: "+ref_field.name+" - "+"tf: "+target_field.name+" - "+"d: "+date);
  }
</script>
Don