There are a variety of ways of doing this. This is one method. In the attached form I have a radio button group called 'required' that contains 'Yes' (1) and 'No' (0). There is a text field called 'acctNumber' also. On the exit event of 'acctNumber' I check if 'acctNumber' is null. If it is, I then check if 'required' has been set to 'Yes'. If it is set to 'Yes' I then put up an alert box with a message indicating 'acctNumber' is required.
// form1.page1.subform1.acctNumber::exit - (JavaScript, client)
if (this.rawValue == "" || this.isNull) {
if (form1.page1.subform1.required.rawValue == 1) {
xfa.host.messageBox("Account number is a required field.","Account Number");
}
}
If you intend to submit the form (via email or to a server via HTTP, for example) and you need to validate the required fields are filled, additional scripting will be required on the submit button.
Steve
FYI. For form related questions, post to the LiveCycle ES Designer forum. That forum is watched very closely.