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