I have a Designer 7 form where every field must be filled and the user must not go on to the next field until the current one is completed.
In Designer 5 the following 'OnExit' script would always set focus to the required field no matter what the user tried to do.
// Ensure that a Surveyor Name is entered.
if (SURVEYOR_NAME.Value == "")
{Form.MsgBox(0, "You must choose a (surveyor) 'Name'","Missing Information");
Form.GoToField(SURVEYOR_NAME, 1);}
In Designer 7 selecting the 'Value / Type / User Entered - Required' only produces a one-off message that the user can ignore. As a result I've tried using 'exit' script along the lines of:
// Ensure that an Action is entered.
if (Action1.rawValue == null)
{xfa.host.messageBox("Please select an appropriate action from the list provided.","Missing Information 1",0);
xfa.host.setFocus("Action1");}
Although this script will work when there is just one field on the form, when there several fields (all with similar script) the focus does not remain on the appropriate field. As this must be common requirement I'm sure that there is a simple solution out there somewhere - any help would be much appreciated.