code: protected Form getNearestForm()
      {
          Tag parentTag = getParent();
          while (parentTag != null) {
              if (parentTag instanceof Form)
                  return (Form) parentTag;
              parentTag = parentTag.getParent();
          }
          return null;
      }
docs: Returns the closest parent form tag, or null if there is none.