I have two of the same forms that I have to put on the intranet for employees except one of them has modifications that the other does not have. There's a date field called Date of Admission on the form and what I want to do is that the new form can only be completed if the date of admission is either on or after 07/01/2009. So if they enter a date that's equal or after 07/01/2009 they can use the form. If they enter a date prior to that date I would like a pop-up box that tells them they can't use that form because it's prior to said said.
I will also add the code to the old form as well that if they enter a date after 07/01/2009 they can't use it.
I don't know of that's a Formcalc or a Javascript I need to put in there.
ie. Sorry you can't use this form Date of Admission must be on or after 07/01/2009, Try the old one instead.
Thanks!
For Date Of Admission, make these fields: "Month" "Date" "Year".
Put all other fields on a subform named MainFields.
Make MainFields subform Hidden when form opens.
Put script on both Month and/or Year fields with IF statement about month and year like this: (fill in the correct javascript to do each of these parts)
if((the month is July, August, September, October, November, or December) && (year >=2009))
{
MainFields.presence = "visible"
}
else
{MainFields.presence = "hidden"
var cResponse = app.alert({
cMsg: "Sorry, you cannot use this form. Please use form xxxxx instead.",
nIcon: 2, nType: 2,
cTitle: "Wrong Form"})
}
I will leave the exact javascript to you. This is only a general direction in which to go.
You could also make the MainFields subform fields all read-only instead of Hidden.