We're using FormAPI to validate our DCRs, but we have the following bug with an expiration date field. If the radio button for ComplianceCodeSettings is set to "Not exempt", we want the expiration date field to be required. It works as expected unless a user enters a valid date, saves the DCR but then goes back to the field and deletes the date and saves the DCR again. Thanks for any advice.
var radio = IWDatacapture.getItem("/ComplianceCodeSettings");
if(radio.getValue()==null)
{
radio.setValue(0);
IWDatacapture.getItem("/ExpireDate").setRequired(true);
}
else if(radio.getValue()==0)
{
IWDatacapture.getItem("/ExpireDate").setRequired(true);
}