Francois,
There are more traditional ways to validate data entered on a form. What jimmypham proposed is certainly valid but it can get you into trouble because it attempts to set the input focus back to the field containing the error.
If this isn't a requirement, then I suggest you use simple validation scripts on each of the month, day and year fields (I'm assuming the "2 adjacent field" are the day and year fields) and set each field's Type property (on the Object palette's Value tab) as
User Entered - Required so that the form can't be submitted without those values entered correctly.
On the month field's Validate event (use the Script Editor palette to edit a field's script), you could use the following JavaScript:
this.rawValue != null && this.rawValue >= 1 && this.rawValue <= 12
This will show an error message if the month entered is not between 1 and 12. On the day field's Validate event, the following JavaScript:
this.rawValue != null && this.rawValue >= 1 && this.rawValue <= 31
And on the year field's validate event, the following JavaScript:
this.rawValue != null && this.rawValue >= 1900
Finally, you can specify the validation error message that Acrobat displays by setting each field's Validation Script Message property on the Object palette's Value tab.
I've attached a sample form which has 3 fields: month, day and year. Each field is required and has the pertaining validation script from above assigned to it as well as a Validation Script Message. The form also has an email submit button. If you try to submit the form when the data is incorrect, you'll get a message from Acrobat telling you that there are fields with incorrect data and therefore the form can't be submitted yet.
Stefan
Adobe Systems