validateAndSave method

bool validateAndSave()

Validates the form and, if valid, calls save. Returns whether the form was valid.

Implementation

bool validateAndSave() {
  if (!validate()) {
    return false;
  }
  save();
  return true;
}