|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.html.DomNode
com.gargoylesoftware.htmlunit.html.DomNamespaceNode
com.gargoylesoftware.htmlunit.html.DomElement
com.gargoylesoftware.htmlunit.html.HtmlElement
com.gargoylesoftware.htmlunit.html.StyledElement
com.gargoylesoftware.htmlunit.html.ClickableElement
com.gargoylesoftware.htmlunit.html.HtmlForm
public class HtmlForm
Wrapper for the HTML element "form".
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement |
---|
HtmlElement.ChildElementsIterator |
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
---|
DomNode.ChildIterator, DomNode.DescendantElementsIterator |
Field Summary | |
---|---|
static java.lang.String |
TAG_NAME
The HTML tag represented by this element. |
Fields inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement |
---|
TAB_INDEX_OUT_OF_BOUNDS |
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomElement |
---|
ATTRIBUTE_NOT_DEFINED, ATTRIBUTE_VALUE_EMPTY |
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
---|
AS_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_UNINITIALIZED |
Fields inherited from interface org.w3c.dom.Node |
---|
ATTRIBUTE_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 |
Method Summary | ||
---|---|---|
java.lang.String |
getAcceptAttribute()
Returns the value of the attribute "accept". |
|
java.lang.String |
getAcceptCharsetAttribute()
Returns the value of the attribute "accept-charset". |
|
java.lang.String |
getActionAttribute()
Returns the value of the attribute "action". |
|
HtmlButton |
getButtonByCaption(java.lang.String caption)
|
|
HtmlButton |
getButtonByName(java.lang.String name)
Returns the first HtmlButton element in this form that has the specified name. |
|
java.util.List<HtmlButton> |
getButtonsByName(java.lang.String name)
Returns all the HtmlButton elements in this form that have the specified name. |
|
HtmlRadioButtonInput |
getCheckedRadioButton(java.lang.String name)
Returns the first checked radio button with the specified name. |
|
java.lang.String |
getEnctypeAttribute()
Returns the value of the attribute "enctype". |
|
|
getInputByName(java.lang.String name)
Returns the first input element which is a member of this form and has the specified name. |
|
|
getInputByValue(java.lang.String value)
Returns the first input in this form with the specified value. |
|
java.util.List<HtmlInput> |
getInputsByName(java.lang.String name)
Returns all input elements which are members of this form and have the specified name. |
|
java.util.List<HtmlInput> |
getInputsByValue(java.lang.String value)
Returns all the inputs in this form with the specified value. |
|
java.util.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. |
|
java.lang.String |
getMethodAttribute()
Returns the value of the attribute "method". |
|
java.lang.String |
getNameAttribute()
Returns the value of the attribute "name". |
|
java.lang.String |
getOnResetAttribute()
Returns the value of the attribute "onreset". |
|
java.lang.String |
getOnSubmitAttribute()
Returns the value of the attribute "onsubmit". |
|
java.util.List<HtmlRadioButtonInput> |
getRadioButtonsByName(java.lang.String name)
Returns all the HtmlRadioButtonInput elements in this form that have the specified name. |
|
HtmlSelect |
getSelectByName(java.lang.String name)
Returns the first HtmlSelect element in this form that has the specified name. |
|
java.util.List<HtmlSelect> |
getSelectsByName(java.lang.String name)
Returns all the HtmlSelect elements in this form that have the specified name. |
|
HtmlSubmitInput |
getSubmitButton()
Gets the first <input type="submit"> element in this form. |
|
java.util.List<HtmlSubmitInput> |
getSubmitButtons()
Returns all the <input type="submit"> elements in this form. |
|
java.lang.String |
getTargetAttribute()
Returns the value of the attribute "target". |
|
HtmlTextArea |
getTextAreaByName(java.lang.String name)
Returns the first HtmlTextArea element in this form that has the specified name. |
|
java.util.List<HtmlTextArea> |
getTextAreasByName(java.lang.String name)
Returns all the HtmlTextArea elements in this form that have the specified name. |
|
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(java.lang.String action)
Sets the value of the attribute "action". |
|
void |
setEnctypeAttribute(java.lang.String encoding)
Sets the value of the attribute "enctype". |
|
void |
setMethodAttribute(java.lang.String method)
Sets the value of the attribute "method". |
|
void |
setNameAttribute(java.lang.String name)
Sets the value of the attribute "name". |
|
void |
setTargetAttribute(java.lang.String target)
Sets the value of the attribute "target". |
|
Page |
submit()
Submit this form as if the first <input type="submit" button in the form was clicked. |
|
Page |
submit(SubmittableElement submitElement)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. |
Methods inherited from class com.gargoylesoftware.htmlunit.html.StyledElement |
---|
getClassAttribute, getIdAttribute, getStyleAttribute, getTitleAttribute |
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomElement |
---|
cloneNode, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributesMap, getElementsByTagName, getElementsByTagNameNS, getNodeType, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, hasAttributes, isEmptyXmlTagExpanded, namespaces, printOpeningTagContentAsXml, printXml, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS |
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNamespaceNode |
---|
getLocalName, getNamespaceURI, getPrefix, getQualifiedName, setPrefix |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
---|
appendChild, 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, setUserData |
Field Detail |
---|
public static final java.lang.String TAG_NAME
Method Detail |
---|
public Page submit() throws java.io.IOException
java.io.IOException
submit(SubmittableElement)
public Page submit(SubmittableElement submitElement) throws java.io.IOException
Submits this form to the server. If submitElement is null, then the submission is treated as if it was triggered by JavaScript, and the onsubmit handler will not be executed.
IMPORTANT: Using this method directly is not the preferred way of submitting forms.
Most consumers should emulate the user's actions instead, probably by using something like
HtmlElement.click()
or HtmlElement.dblClick()
.
submitElement
- the element that caused the submit to occur
java.io.IOException
- if an IO error occurspublic Page reset()
public java.util.List<HtmlSubmitInput> getSubmitButtons() throws ElementNotFoundException
ElementNotFoundException
public HtmlSubmitInput getSubmitButton() throws ElementNotFoundException
ElementNotFoundException
public java.util.List<HtmlInput> getInputsByName(java.lang.String name)
name
- the input name to search for
public final <I extends HtmlInput> I getInputByName(java.lang.String name) throws ElementNotFoundException
I
- the input typename
- the input name to search for
ElementNotFoundException
- if there is not input in this form with the specified namepublic java.util.List<HtmlSelect> getSelectsByName(java.lang.String name)
HtmlSelect
elements in this form that have the specified name.
name
- the name to search for
HtmlSelect
elements in this form that have the specified namepublic HtmlSelect getSelectByName(java.lang.String name) throws ElementNotFoundException
HtmlSelect
element in this form that has the specified name.
name
- the name to search for
HtmlSelect
element in this form that has the specified name
ElementNotFoundException
- if this form does not contain a HtmlSelect
element with the specified namepublic java.util.List<HtmlButton> getButtonsByName(java.lang.String name)
HtmlButton
elements in this form that have the specified name.
name
- the name to search for
HtmlButton
elements in this form that have the specified namepublic HtmlButton getButtonByName(java.lang.String name) throws ElementNotFoundException
HtmlButton
element in this form that has the specified name.
name
- the name to search for
HtmlButton
element in this form that has the specified name
ElementNotFoundException
- if this form does not contain a HtmlButton
element with the specified namepublic HtmlButton getButtonByCaption(java.lang.String caption) throws ElementNotFoundException
ElementNotFoundException
public java.util.List<HtmlTextArea> getTextAreasByName(java.lang.String name)
HtmlTextArea
elements in this form that have the specified name.
name
- the name to search for
HtmlTextArea
elements in this form that have the specified namepublic HtmlTextArea getTextAreaByName(java.lang.String name) throws ElementNotFoundException
HtmlTextArea
element in this form that has the specified name.
name
- the name to search for
HtmlTextArea
element in this form that has the specified name
ElementNotFoundException
- if this form does not contain a HtmlTextArea
element with the specified namepublic java.util.List<HtmlRadioButtonInput> getRadioButtonsByName(java.lang.String name)
HtmlRadioButtonInput
elements in this form that have the specified name.
name
- the name to search for
HtmlRadioButtonInput
elements in this form that have the specified namepublic HtmlRadioButtonInput getCheckedRadioButton(java.lang.String name)
name
- the name of the radio button
public final java.lang.String getActionAttribute()
public final void setActionAttribute(java.lang.String action)
action
- the value of the attribute "action"public final java.lang.String getMethodAttribute()
public final void setMethodAttribute(java.lang.String method)
method
- the value of the attribute "method"public final java.lang.String getNameAttribute()
public final void setNameAttribute(java.lang.String name)
name
- the value of the attribute "name"public final java.lang.String getEnctypeAttribute()
public final void setEnctypeAttribute(java.lang.String encoding)
encoding
- the value of the attribute "enctype"public final java.lang.String getOnSubmitAttribute()
public final java.lang.String getOnResetAttribute()
public final java.lang.String getAcceptAttribute()
public final java.lang.String getAcceptCharsetAttribute()
public final java.lang.String getTargetAttribute()
public final void setTargetAttribute(java.lang.String target)
target
- the value of the attribute "target"public <I extends HtmlInput> I getInputByValue(java.lang.String value) throws ElementNotFoundException
I
- the input typevalue
- the value to search for
ElementNotFoundException
- if this form does not contain any inputs with the specified valuepublic java.util.List<HtmlInput> getInputsByValue(java.lang.String value)
value
- the value to search for
public java.util.List<HtmlElement> getLostChildren()
protected void preventDefault()
preventDefault
in class HtmlElement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |