The fields interface acts as a parent for all Fields within a Form, Integration Service or Workflow Process. Individual Fields are accessed using their name e.g. fields.myField.
Field values are retrieved and set in script using the value property:
if(fields.age.value >= 18){
fields.userType.value = "Adult";
}
else{
fields.userType.value = "Child";
}
You can get the Field Control that displays a field on the current page using fields.myControl.getFieldControl(). If there are multiple Field Controls displaying a field then only the first will be returned. An optional page parameter can be passed to retrieve a Field Control from a specified page.