There are a variety of scripting techniques that can be used based upon the form requirements, UI aesthetics, designer preference,... The script below forces data entry into a text field object called 'tf1' but it is a dangerous practice and should be used carefully. You may find yourself in a infinite loop based upon the tab order. A safer pattern includes global field validation upon submit.
// form1.page1.subform1.tf1::exit - (JavaScript, client)
if (this.isNull) {
xfa.host.messageBox("tf1 is a mandatory field.","Text Field 1 Error",0);
xfa.host.setFocus("form1.page1.subform1.tf1");
}
Steve