I have a form and on the add form, I have a validate type comparing dates.
On the add form, this works fine and if the expiration date/time is before the effective date, it notifies me of such. Once I make the expiration date after the effective date, it allows me to add the item.
But, when I got to edit the item, no matter what date/time I put in (even a year later), it keeps telling me that the expiration date is before the effective date.
Any ideas why? In essence, it's the same code but on the different forms, but edit doesn't work properly.
Add Form:
<div>
<Label For="EffectiveDate" Text="Effective Date" CssClass="NormalBold xmp-form-label" /
<DateInput id="EffectiveDate" DataField="EffectiveDate" DataType="datetime" Nullable="True" />
<CalendarButton text="Select Date" target="EffectiveDate" format="MM-dd-yyyy hh:mm tt" />
</div>
<div>
<Label For="ExpirationDate" Text="Expiration Date" CssClass="NormalBold xmp-form-label" />
<DateInput id="ExpirationDate" DataField="ExpirationDate" DataType="datetime" Nullable="True" />
<CalendarButton text="Select Date" target="ExpirationDate" format="MM-dd-yyyy hh:mm tt" />
<Validate type="compare" target="EffectiveDate" comparetarget="ExpirationDate" Operator="LessThan" text="*" message="The Expiration Date / Time is less then Effective Date." />
</div>
Edit Form:
<div>
<Label For="EffectiveDate" Text="Effective Date" CssClass="NormalBold xmp-form-label" />
<DateInput id="EffectiveDate" DataField="EffectiveDate" DataType="datetime" Nullable="True" />
<CalendarButton text="Select Date" target="EffectiveDate" format="MM-dd-yyyy hh:mm tt" />
</div>
<div>
<Label For="ExpirationDate" Text="Expiration Date" CssClass="NormalBold xmp-form-label" />
<DateInput id="ExpirationDate" DataField="ExpirationDate" DataType="datetime" Nullable="True" />
<CalendarButton text="Select Date" target="ExpirationDate" format="MM-dd-yyyy hh:mm tt" />
<Validate type="compare" target="EffectiveDate" comparetarget="ExpirationDate" Operator="LessThan" text="*" message="The Expiration Date / Time is less then Effective Date." />
</div>