public class HtmlForm extends HtmlElement
HtmlElement.DisplayStyleDomElement.ChildElementsIteratorDomNode.ChildIterator, DomNode.DescendantElementsIterator<T extends DomNode>| Modifier and Type | Field and Description |
|---|---|
static String |
TAG_NAME
The HTML tag represented by this element.
|
TAB_INDEX_OUT_OF_BOUNDSATTRIBUTE_NOT_DEFINED, ATTRIBUTE_VALUE_EMPTYAS_TEXT_BLANK, AS_TEXT_BLOCK_SEPARATOR, AS_TEXT_NEW_LINE, AS_TEXT_TAB, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZEDATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE| Modifier and Type | Method and Description |
|---|---|
String |
getAcceptAttribute()
Returns the value of the attribute
accept. |
String |
getAcceptCharsetAttribute()
Returns the value of the attribute
accept-charset. |
String |
getActionAttribute()
Returns the value of the attribute
action. |
HtmlButton |
getButtonByName(String name)
Returns the first
HtmlButton element in this form that has the specified name. |
List<HtmlButton> |
getButtonsByName(String name)
Returns all the
HtmlButton elements in this form that have the specified name. |
HtmlRadioButtonInput |
getCheckedRadioButton(String name)
Returns the first checked radio button with the specified name.
|
String |
getEnctypeAttribute()
Returns the value of the attribute
enctype. |
<I extends HtmlInput> |
getInputByName(String name)
Returns the first input element which is a member of this form and has the specified name.
|
<I extends HtmlInput> |
getInputByValue(String value)
Returns the first input in this form with the specified value.
|
List<HtmlInput> |
getInputsByName(String name)
Returns all input elements which are members of this form and have the specified name.
|
List<HtmlInput> |
getInputsByValue(String value)
Returns all the inputs in this form with the specified value.
|
List<HtmlElement> |
getLostChildren()
Gets the form elements that may be submitted but that don't belong to the form's children
in the DOM due to incorrect HTML code.
|
String |
getMethodAttribute()
Returns the value of the attribute
method. |
String |
getNameAttribute()
Returns the value of the attribute
name. |
String |
getOnResetAttribute()
Returns the value of the attribute
onreset. |
String |
getOnSubmitAttribute()
Returns the value of the attribute
onsubmit. |
List<NameValuePair> |
getParameterListForSubmit(SubmittableElement submitElement)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Returns a list of NameValuePairs that represent the data that will be
sent to the server when this form is submitted. |
List<HtmlRadioButtonInput> |
getRadioButtonsByName(String name)
Returns all the
HtmlRadioButtonInput elements in this form that have the specified name. |
HtmlSelect |
getSelectByName(String name)
Returns the first
HtmlSelect element in this form that has the specified name. |
List<HtmlSelect> |
getSelectsByName(String name)
Returns all the
HtmlSelect elements in this form that have the specified name. |
String |
getTargetAttribute()
Returns the value of the attribute
target. |
HtmlTextArea |
getTextAreaByName(String name)
Returns the first
HtmlTextArea element in this form that has the specified name. |
List<HtmlTextArea> |
getTextAreasByName(String name)
Returns all the
HtmlTextArea elements in this form that have the specified name. |
WebRequest |
getWebRequest(SubmittableElement submitElement)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Gets the request for a submission of this form with the specified SubmittableElement. |
protected boolean |
isEmptyXmlTagExpanded()
Browsers have problems with self closing form tags.
|
protected void |
preventDefault()
This method is called if the current fired event is canceled by preventDefault() in FireFox,
or by returning
false in Internet Explorer. |
Page |
reset()
Resets this form to its initial values, returning the page contained by this form's window after the
reset.
|
void |
setActionAttribute(String action)
Sets the value of the attribute
action. |
void |
setEnctypeAttribute(String encoding)
Sets the value of the attribute
enctype. |
void |
setMethodAttribute(String method)
Sets the value of the attribute
method. |
void |
setNameAttribute(String name)
Sets the value of the attribute
name. |
void |
setTargetAttribute(String target)
Sets the value of the attribute
target. |
acceptChar, addHtmlAttributeChangeListener, appendChildIfNoneExists, checkChildHierarchy, detach, doType, doType, fireHtmlAttributeAdded, fireHtmlAttributeRemoved, fireHtmlAttributeReplaced, getCanonicalXPath, getDefaultStyleDisplay, getElementsByAttribute, getEnclosingElement, getEnclosingForm, getEnclosingFormOrDie, getLangAttribute, getNodeName, getOnClickAttribute, getOnDblClickAttribute, getOneHtmlElementByAttribute, getOnKeyDownAttribute, getOnKeyPressAttribute, getOnKeyUpAttribute, getOnMouseDownAttribute, getOnMouseMoveAttribute, getOnMouseOutAttribute, getOnMouseOverAttribute, getOnMouseUpAttribute, getSrcAttributeNormalized, getTabIndex, getTextDirectionAttribute, getXmlLangAttribute, handles, hasEventHandlers, isAltPressed, isAttributeCaseSensitive, isCtrlPressed, isDisplayed, isRequired, isRequiredSupported, isShiftPressed, isSubmittableByEnter, isValid, notifyAttributeChangeListeners, removeAttribute, removeChild, removeHtmlAttributeChangeListener, setAttributeNode, setAttributeNS, setRequired, type, type, type, type, typeDoneblur, click, click, click, click, cloneNode, dblClick, dblClick, doClickFireChangeEvent, doClickFireClickEvent, doClickStateUpdate, fireEvent, fireEvent, focus, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributesMap, getChildElementCount, getChildElements, getElementsByTagName, getElementsByTagNameNS, getEventTargetElement, getFirstElementChild, getId, getLastElementChild, getNodeType, getSchemaTypeInfo, getStyleElement, getStyleElementCaseInSensitive, getStyleMap, getTagName, hasAttribute, hasAttributeNS, hasAttributes, isMouseOver, isStateUpdateFirst, matches, mouseDown, mouseDown, mouseMove, mouseMove, mouseOut, mouseOut, mouseOver, mouseOver, mouseUp, mouseUp, printOpeningTagContentAsXml, printXml, propagateClickStateUpdateToParent, removeAttributeNode, removeAttributeNS, removeFocus, removeStyleAttribute, replaceStyleAttribute, rightClick, rightClick, setAttribute, setAttributeNodeNS, setAttributeNS, setId, setIdAttribute, setIdAttributeNode, setIdAttributeNS, toString, writeStyleToElementgetLocalName, getNamespaceURI, getPrefix, getQualifiedName, processImportNode, setPrefixaddCharacterDataChangeListener, addDomChangeListener, appendChild, asText, asXml, basicRemove, compareDocumentPosition, fireCharacterDataChanged, fireNodeAdded, fireNodeDeleted, getAncestors, getBaseURI, getByXPath, getByXPath, getChildNodes, getChildren, getDescendants, getDomElementDescendants, getEndColumnNumber, getEndLineNumber, getFeature, getFirstByXPath, getFirstByXPath, getFirstChild, getHtmlElementDescendants, getHtmlPageOrNull, getIndex, getLastChild, getNextElementSibling, getNextSibling, getNodeValue, getOwnerDocument, getPage, getParentNode, getPreviousElementSibling, getPreviousSibling, getReadyState, getScriptableObject, getSelectorList, getStartColumnNumber, getStartLineNumber, getTextContent, getUserData, hasChildNodes, hasFeature, insertBefore, insertBefore, isAncestorOf, isAncestorOfAny, isAttachedToPage, isDefaultNamespace, isEqualNode, isSameNode, isSupported, isTrimmedText, lookupNamespaceURI, lookupPrefix, mayBeDisplayed, normalize, notifyIncorrectness, onAddedToDocumentFragment, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, querySelector, querySelectorAll, remove, removeAllChildren, removeCharacterDataChangeListener, removeChild, removeDomChangeListener, replace, replaceChild, setNextSibling, setNodeValue, setParentNode, setPreviousSibling, setReadyState, setScriptableObject, setTextContent, setUserDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitappendChild, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserDatapublic static final String TAG_NAME
public WebRequest getWebRequest(SubmittableElement submitElement)
submitElement - the element that caused the submit to occurpublic List<NameValuePair> getParameterListForSubmit(SubmittableElement submitElement)
NameValuePairs that represent the data that will be
sent to the server when this form is submitted. This is primarily intended to aid
debugging.submitElement - the element used to submit the form, or null if the
form was submitted by JavaScriptNameValuePairs that represent that data that will be sent
to the server when this form is submittedpublic Page reset()
public List<HtmlInput> getInputsByName(String name)
name - the input name to search forpublic final <I extends HtmlInput> I getInputByName(String name) throws ElementNotFoundException
I - the input typename - the input name to search forElementNotFoundException - if there is not input in this form with the specified namepublic List<HtmlSelect> getSelectsByName(String name)
HtmlSelect elements in this form that have the specified name.name - the name to search forHtmlSelect elements in this form that have the specified namepublic HtmlSelect getSelectByName(String name) throws ElementNotFoundException
HtmlSelect element in this form that has the specified name.name - the name to search forHtmlSelect element in this form that has the specified nameElementNotFoundException - if this form does not contain a HtmlSelect
element with the specified namepublic List<HtmlButton> getButtonsByName(String name)
HtmlButton elements in this form that have the specified name.name - the name to search forHtmlButton elements in this form that have the specified namepublic HtmlButton getButtonByName(String name) throws ElementNotFoundException
HtmlButton element in this form that has the specified name.name - the name to search forHtmlButton element in this form that has the specified nameElementNotFoundException - if this form does not contain a HtmlButton
element with the specified namepublic List<HtmlTextArea> getTextAreasByName(String name)
HtmlTextArea elements in this form that have the specified name.name - the name to search forHtmlTextArea elements in this form that have the specified namepublic HtmlTextArea getTextAreaByName(String name) throws ElementNotFoundException
HtmlTextArea element in this form that has the specified name.name - the name to search forHtmlTextArea element in this form that has the specified nameElementNotFoundException - if this form does not contain a HtmlTextArea
element with the specified namepublic List<HtmlRadioButtonInput> getRadioButtonsByName(String name)
HtmlRadioButtonInput elements in this form that have the specified name.name - the name to search forHtmlRadioButtonInput elements in this form that have the specified namepublic HtmlRadioButtonInput getCheckedRadioButton(String name)
null.name - the name of the radio buttonpublic final String getActionAttribute()
action. Refer to the HTML 4.01 documentation for
details on the use of this attribute.action or an empty string if that attribute isn't definedpublic final void setActionAttribute(String action)
action. Refer to the HTML 4.01 documentation for
details on the use of this attribute.action - the value of the attribute actionpublic final String getMethodAttribute()
method. Refer to the HTML 4.01 documentation for
details on the use of this attribute.method or an empty string if that attribute isn't definedpublic final void setMethodAttribute(String method)
method. Refer to the HTML 4.01 documentation for
details on the use of this attribute.method - the value of the attribute methodpublic final String getNameAttribute()
name. Refer to the HTML 4.01 documentation for
details on the use of this attribute.name or an empty string if that attribute isn't definedpublic final void setNameAttribute(String name)
name. Refer to the HTML 4.01 documentation for
details on the use of this attribute.name - the value of the attribute namepublic final String getEnctypeAttribute()
enctype. Refer to the HTML 4.01 documentation for
details on the use of this attribute. "Enctype" is the encoding type
used when submitting a form back to the server.enctype or an empty string if that attribute isn't definedpublic final void setEnctypeAttribute(String encoding)
enctype. Refer to the HTML 4.01 documentation for
details on the use of this attribute. "Enctype" is the encoding type
used when submitting a form back to the server.encoding - the value of the attribute enctypepublic final String getOnSubmitAttribute()
onsubmit. Refer to the HTML 4.01 documentation for
details on the use of this attribute.onsubmit or an empty string if that attribute isn't definedpublic final String getOnResetAttribute()
onreset. Refer to the HTML 4.01 documentation for
details on the use of this attribute.onreset or an empty string if that attribute isn't definedpublic final String getAcceptAttribute()
accept. Refer to the HTML 4.01 documentation for
details on the use of this attribute.accept or an empty string if that attribute isn't definedpublic final String getAcceptCharsetAttribute()
accept-charset. Refer to the
HTML 4.01 documentation for details on the use of this attribute.accept-charset or an empty string if that attribute isn't definedpublic final String getTargetAttribute()
target. Refer to the HTML 4.01 documentation for
details on the use of this attribute.target or an empty string if that attribute isn't definedpublic final void setTargetAttribute(String target)
target. Refer to the HTML 4.01 documentation for
details on the use of this attribute.target - the value of the attribute targetpublic <I extends HtmlInput> I getInputByValue(String value) throws ElementNotFoundException
I - the input typevalue - the value to search forElementNotFoundException - if this form does not contain any inputs with the specified valuepublic List<HtmlInput> getInputsByValue(String value)
value - the value to search forpublic List<HtmlElement> getLostChildren()
protected void preventDefault()
false in Internet Explorer.
The default implementation does nothing.preventDefault in class DomElementprotected boolean isEmptyXmlTagExpanded()
isEmptyXmlTagExpanded in class DomElementfalse by defaultCopyright © 2002–2017 Gargoyle Software Inc.. All rights reserved.