com.gargoylesoftware.htmlunit.javascript.host.html
Class HTMLFormElement

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.Node
              extended by com.gargoylesoftware.htmlunit.javascript.host.EventNode
                  extended by com.gargoylesoftware.htmlunit.javascript.host.Element
                      extended by com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
                          extended by com.gargoylesoftware.htmlunit.javascript.host.html.HTMLFormElement
All Implemented Interfaces:
ScriptableWithFallbackGetter, Serializable, Cloneable, Map, net.sourceforge.htmlunit.corejs.javascript.Callable, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Function, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class HTMLFormElement
extends HTMLElement
implements net.sourceforge.htmlunit.corejs.javascript.Function

A JavaScript object for a Form.

Version:
$Revision: 5893 $
Author:
Mike Bowler, Daniel Gredler, Kent Tong, Chris Erskine, Marc Guillemot, Ahmed Ashour, Sudhan Moghe
See Also:
MSDN documentation, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
HTMLElement.ProxyDomNode
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
BEHAVIOR_ID_CLIENT_CAPS, BEHAVIOR_ID_DOWNLOAD, BEHAVIOR_ID_HOMEPAGE
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.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
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
HTMLFormElement()
          Creates an instance.
 
Method Summary
 Object call(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable scope, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args)
          
 net.sourceforge.htmlunit.corejs.javascript.Scriptable construct(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable scope, Object[] args)
          
 Object get(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
          Returns the specified indexed property.
protected  Object getWithPreemption(String name)
          Overridden to allow the retrieval of certain form elements by ID or name.
 Object jsxFunction_item(Object index, Object subIndex)
          Retrieves a form object or an object from an elements collection.
 void jsxFunction_reset()
          Resets this form.
 void jsxFunction_submit()
          Submits the form (at the end of the current script execution).
 String jsxGet_action()
          Returns the value of the JavaScript attribute "action".
 HTMLCollection jsxGet_elements()
          Returns the value of the JavaScript attribute "elements".
 String jsxGet_encoding()
          Returns the value of the JavaScript attribute "encoding".
 int jsxGet_length()
          Returns the value of the JavaScript attribute "length".
 String jsxGet_method()
          Returns the value of the JavaScript attribute "method".
 String jsxGet_name()
          Returns the value of the JavaScript attribute "name".
 Object jsxGet_onsubmit()
          Returns the onsubmit event handler for this element.
 String jsxGet_target()
          Returns the value of the JavaScript attribute "target".
 void jsxSet_action(String action)
          Sets the value of the JavaScript attribute "action".
 void jsxSet_encoding(String encoding)
          Sets the value of the JavaScript attribute "encoding".
 void jsxSet_method(String method)
          Sets the value of the JavaScript attribute "method".
 void jsxSet_name(String name)
          Sets the value of the JavaScript attribute "name".
 void jsxSet_onsubmit(Object onsubmit)
          Sets the onsubmit event handler for this element.
 void jsxSet_target(String target)
          Sets the value of the JavaScript attribute "target".
 void setHtmlElement(HtmlElement htmlElement)
          Sets the HTML element that corresponds to this JavaScript object.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
addComponentRequest, clearComponentRequest, compareVersions, createEventHandler, doComponentRequest, fixAttributeName, getAlign, getAvailHeight, getAvailWidth, getBoxObject, getBufferDepth, getCh, getChOff, getColorDepth, getComponentVersion, getConnectionType, getCookieEnabled, getCpuClass, getDomNodeOrDie, getDomNodeOrNull, getHeight, getJavaEnabled, getParentHTMLElement, getPlatform, getPosX, getPosY, getSystemLanguage, getUserLanguage, getVAlign, getWidth, getWidthOrHeight, getWithFallback, isAncestorOfEventTarget, isAttributeName, isComponentInstalled, isHomePage, jsxFunction_addBehavior, jsxFunction_blur, jsxFunction_clearAttributes, jsxFunction_click, jsxFunction_contains, jsxFunction_createTextRange, jsxFunction_dispatchEvent, jsxFunction_doScroll, jsxFunction_focus, jsxFunction_getAttributeNode, jsxFunction_getAttributeNodeNS, jsxFunction_getAttributeNS, jsxFunction_getBoundingClientRect, jsxFunction_getClientRects, jsxFunction_getElementsByClassName, jsxFunction_getElementsByTagName, jsxFunction_hasAttributeNS, jsxFunction_insertAdjacentElement, jsxFunction_insertAdjacentHTML, jsxFunction_mergeAttributes, jsxFunction_removeAttributeNode, jsxFunction_removeAttributeNS, jsxFunction_removeBehavior, jsxFunction_removeExpression, jsxFunction_removeNode, jsxFunction_scrollIntoView, jsxFunction_setActive, jsxFunction_setAttribute, jsxFunction_setAttributeNode, jsxFunction_setAttributeNS, jsxFunction_setExpression, jsxGet_accessKey, jsxGet_all, jsxGet_children, jsxGet_className, jsxGet_clientHeight, jsxGet_clientLeft, jsxGet_clientTop, jsxGet_clientWidth, jsxGet_currentStyle, jsxGet_dir, jsxGet_disabled, jsxGet_document, jsxGet_filters, jsxGet_id, jsxGet_innerHTML, jsxGet_innerText, jsxGet_lang, jsxGet_language, jsxGet_localName, jsxGet_namespaceURI, jsxGet_nodeName, jsxGet_offsetHeight, jsxGet_offsetLeft, jsxGet_offsetParent, jsxGet_offsetTop, jsxGet_offsetWidth, jsxGet_outerHTML, jsxGet_parentElement, jsxGet_prefix, jsxGet_runtimeStyle, jsxGet_scopeName, jsxGet_scrollHeight, jsxGet_scrollLeft, jsxGet_scrollTop, jsxGet_scrollWidth, jsxGet_spellcheck, jsxGet_style, jsxGet_tabIndex, jsxGet_tagUrn, jsxGet_title, jsxGet_uniqueID, jsxSet_accessKey, jsxSet_className, jsxSet_dir, jsxSet_disabled, jsxSet_id, jsxSet_innerHTML, jsxSet_innerText, jsxSet_lang, jsxSet_language, jsxSet_outerHTML, jsxSet_scrollLeft, jsxSet_scrollTop, jsxSet_spellcheck, jsxSet_tabIndex, jsxSet_tagUrn, jsxSet_textContent, jsxSet_title, navigateHomePage, parseHtmlSnippet, readAttributes, setAlign, setCh, setChOff, setColorAttribute, setDefaults, setDomNode, setHomePage, setVAlign, setWidthOrHeight, startDownload, toString
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Element
createAttributesObject, jsxFunction_getAttribute, jsxFunction_getElementsByTagNameNS, jsxFunction_hasAttribute, jsxFunction_removeAttribute, jsxFunction_selectNodes, jsxFunction_selectSingleNode, jsxGet_attributes, jsxGet_tagName, jsxGet_text
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.EventNode
jsxFunction_fireEvent, jsxGet_onblur, jsxGet_onclick, jsxGet_oncontextmenu, jsxGet_ondblclick, jsxGet_onerror, jsxGet_onfocus, jsxGet_onfocusin, jsxGet_onfocusout, jsxGet_onkeydown, jsxGet_onkeypress, jsxGet_onkeyup, jsxGet_onmousedown, jsxGet_onmousemove, jsxGet_onmouseout, jsxGet_onmouseover, jsxGet_onmouseup, jsxGet_onpropertychange, jsxGet_onresize, jsxSet_onblur, jsxSet_onclick, jsxSet_oncontextmenu, jsxSet_ondblclick, jsxSet_onerror, jsxSet_onfocus, jsxSet_onfocusin, jsxSet_onfocusout, jsxSet_onkeydown, jsxSet_onkeypress, jsxSet_onkeyup, jsxSet_onmousedown, jsxSet_onmousemove, jsxSet_onmouseout, jsxSet_onmouseover, jsxSet_onmouseup, jsxSet_onpropertychange, jsxSet_onresize
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node
executeEvent, fireEvent, getEventHandler, getEventHandlerProp, getJavaScriptNode, getParent, hasEventHandlers, jsxFunction_addEventListener, jsxFunction_appendChild, jsxFunction_attachEvent, jsxFunction_cloneNode, jsxFunction_compareDocumentPosition, jsxFunction_detachEvent, jsxFunction_hasChildNodes, jsxFunction_insertBefore, jsxFunction_insertBefore, jsxFunction_isSameNode, jsxFunction_normalize, jsxFunction_removeChild, jsxFunction_removeEventListener, jsxFunction_replaceChild, jsxGet_childNodes, jsxGet_firstChild, jsxGet_lastChild, jsxGet_nextSibling, jsxGet_nodeType, jsxGet_nodeValue, jsxGet_ownerDocument, jsxGet_parentNode, jsxGet_previousSibling, jsxGet_textContent, jsxGet_xml, jsxSet_nodeValue, setEventHandler, setEventHandlerProp
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
delete, delete, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setParentScope, setPrototype
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

HTMLFormElement

public HTMLFormElement()
Creates an instance. A default constructor is required for all JavaScript objects.

Method Detail

setHtmlElement

public void setHtmlElement(HtmlElement htmlElement)
Sets the HTML element that corresponds to this JavaScript object.

Overrides:
setHtmlElement in class SimpleScriptable
Parameters:
htmlElement - the HTML element

jsxGet_name

public String jsxGet_name()
Returns the value of the JavaScript attribute "name".

Returns:
the value of this attribute

jsxSet_name

public void jsxSet_name(String name)
Sets the value of the JavaScript attribute "name".

Parameters:
name - the new value

jsxGet_elements

public HTMLCollection jsxGet_elements()
Returns the value of the JavaScript attribute "elements".

Returns:
the value of this attribute

jsxGet_length

public int jsxGet_length()
Returns the value of the JavaScript attribute "length". Does not count input type=image elements as browsers (IE6, Mozilla 1.7) do (cf MSDN doc)

Returns:
the value of this attribute

jsxGet_action

public String jsxGet_action()
Returns the value of the JavaScript attribute "action".

Returns:
the value of this attribute

jsxSet_action

public void jsxSet_action(String action)
Sets the value of the JavaScript attribute "action".

Parameters:
action - the new value

jsxGet_method

public String jsxGet_method()
Returns the value of the JavaScript attribute "method".

Returns:
the value of this attribute

jsxSet_method

public void jsxSet_method(String method)
Sets the value of the JavaScript attribute "method".

Parameters:
method - the new value

jsxGet_target

public String jsxGet_target()
Returns the value of the JavaScript attribute "target".

Returns:
the value of this attribute

jsxGet_onsubmit

public Object jsxGet_onsubmit()
Returns the onsubmit event handler for this element.

Returns:
the onsubmit event handler for this element

jsxSet_onsubmit

public void jsxSet_onsubmit(Object onsubmit)
Sets the onsubmit event handler for this element.

Parameters:
onsubmit - the onsubmit event handler for this element

jsxSet_target

public void jsxSet_target(String target)
Sets the value of the JavaScript attribute "target".

Parameters:
target - the new value

jsxGet_encoding

public String jsxGet_encoding()
Returns the value of the JavaScript attribute "encoding".

Returns:
the value of this attribute

jsxSet_encoding

public void jsxSet_encoding(String encoding)
Sets the value of the JavaScript attribute "encoding".

Parameters:
encoding - the new value

jsxFunction_submit

public void jsxFunction_submit()
                        throws IOException
Submits the form (at the end of the current script execution).

Throws:
IOException - if an IO error occurs

jsxFunction_item

public Object jsxFunction_item(Object index,
                               Object subIndex)
Retrieves a form object or an object from an elements collection.

Parameters:
index - Integer or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made
subIndex - Optional. Integer that specifies the zero-based index of the object to retrieve when a collection is returned
Returns:
an object or a collection of objects if successful, or null otherwise

jsxFunction_reset

public void jsxFunction_reset()
Resets this form.


getWithPreemption

protected Object getWithPreemption(String name)
Overridden to allow the retrieval of certain form elements by ID or name.

Overrides:
getWithPreemption in class SimpleScriptable
Parameters:
name - the property name
Returns:
Scriptable.NOT_FOUND if not found

get

public Object get(int index,
                  net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
Returns the specified indexed property.

Specified by:
get in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
Overrides:
get in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
Parameters:
index - the index of the property
start - the scriptable object that was originally queried for this property
Returns:
the property

call

public Object call(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                   net.sourceforge.htmlunit.corejs.javascript.Scriptable scope,
                   net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
                   Object[] args)

Specified by:
call in interface net.sourceforge.htmlunit.corejs.javascript.Callable
Specified by:
call in interface net.sourceforge.htmlunit.corejs.javascript.Function

construct

public net.sourceforge.htmlunit.corejs.javascript.Scriptable construct(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                                                                       net.sourceforge.htmlunit.corejs.javascript.Scriptable scope,
                                                                       Object[] args)

Specified by:
construct in interface net.sourceforge.htmlunit.corejs.javascript.Function


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.