* Convenience method returns the form in which this form element is contained.
* This method is exposed for form elements through the DOM API, but other
* elements have no access to it through the API.
*/
public HTMLFormElement getForm() {
Node parent = getParentNode();
while ( parent != null ) {
if ( parent instanceof HTMLFormElement ) {
return (HTMLFormElement) parent;
}
parent = parent.getParentNode();
}
return null;
}