Package org.loboevolution.html.dom
Interface HTMLInputElement
- All Superinterfaces:
Element,EventTarget,HTMLElement,InnerHTML,ModelNode,Node,NonDocumentTypeChildNode,ParentNode
- All Known Implementing Classes:
HTMLInputElementImpl
Provides special properties and methods for manipulating the options, layout, and presentation of <input> elements.
-
Field Summary
Fields inherited from interface org.loboevolution.html.node.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, NONE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether a form will validate when it is submitted, without having to submit it.Sets or retrieves a comma-separated list of content types.getAlign()Deprecated.getAlt()Sets or retrieves a text alternative to the graphic.Sets or retrieves the initial contents of the object.getDirName.getForm()Retrieves a reference to the form that the object is embedded in.Overrides the action attribute (where the data on a form is sent) on the parent form element.Used to override the encoding (formEnctype attribute) specified on the form element.Overrides the submit method attribute previously specified on a form element.Overrides the target attribute on a form element.doubleSets or retrieves the height of the object.getLabels.getList()Specifies the ID of a pre-defined datalist of options for an input element.getMax()Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.intSets or retrieves the maximum number of characters that the user can enter in a text control.getMin()Defines the minimum acceptable value for an input element with type="number".intgetMinLength.getName()Sets or retrieves the name of the object.Gets or sets a string containing a regular expression that the user's input must match.Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.getSelectionDirection.intGets or sets the end position or offset of a text selection.intGets or sets the starting position or offset of a text selection.intgetSize()getSize.getSrc()The address or URL of the a media resource that is to be considered.getStep()Defines an increment or jump between values that you want to allow the user to enter.getType()Returns the content type of the object.Deprecated.Returns the error message that would be displayed if the user submits the form, or an empty string if no error message.Returns a ValidityState object that represents the validity states of an element.getValue()Returns the value of the data at the cursor's current position.doubleReturns the input field value as a number.doublegetWidth()Sets or retrieves the width of the object.booleanSpecifies whether autocomplete is applied to an editable text field.booleanProvides a way to direct a user to a specific field when a document loads.booleanSets or retrieves the state of the check box or radio button.booleanSets or retrieves the state of the check box or radio button.booleanisDisabled.booleanOverrides any validation or required attributes on a form or form elements to allow it to be submitted without validation.booleanisIndeterminate.booleanSets or retrieves the Boolean value indicating whether multiple items can be selected from a list.booleanisReadOnly.booleanWhen present, marks an element that can't be submitted without a value.booleanReturns whether an element will successfully validate based on forms validation rules and constraints.booleanreportValidity.voidselect()Makes the selection equal to the current object.voidsetAccept.voidDeprecated.voidsetAlt.voidsetAutocomplete(String autocomplete) setAutocomplete.voidsetAutofocus(boolean autofocus) setAutofocus.voidsetChecked(boolean checked) setChecked.voidsetCustomValidity(String error) Sets a custom error message that is displayed when a form is submitted.voidsetDefaultChecked(boolean defaultChecked) setDefaultChecked.voidsetDefaultValue(String defaultValue) setDefaultValue.voidsetDirName(String dirName) setDirName.voidsetDisabled(boolean disabled) setDisabled.voidsetFormAction(String formAction) setFormAction.voidsetFormEnctype(String formEnctype) setFormEnctype.voidsetFormMethod(String formMethod) setFormMethod.voidsetFormNoValidate(boolean formNoValidate) setFormNoValidate.voidsetFormTarget(String formTarget) setFormTarget.voidsetHeight(double height) setHeight.voidsetIndeterminate(boolean indeterminate) setIndeterminate.voidsetMax.voidsetMaxLength(int maxLength) setMaxLength.voidsetMin.voidsetMinLength(int minLength) setMinLength.voidsetMultiple(boolean multiple) setMultiple.voidsetName.voidsetPattern(String pattern) setPattern.voidsetPlaceholder(String placeholder) setPlaceholder.voidsetRangeText(String replacement) setRangeText.voidsetRangeText(String replacement, int start, int end) setRangeText.voidsetRangeText(String select, int start, int end, String preserve) setRangeText.voidsetReadOnly(boolean readOnly) setReadOnly.voidsetRequired(boolean required) setRequired.voidsetSelectionDirection(String selectionDirection) setSelectionDirection.voidsetSelectionEnd(int selectionEnd) setSelectionEnd.voidsetSelectionRange(int start, int end) setSelectionRange.voidsetSelectionRange(int start, int end, Direction direction) Sets the start and end positions of a selection in a text field.voidsetSelectionStart(int selectionStart) setSelectionStart.voidsetSize(int size) setSize.voidsetSrc.voidsetStep.voidsetType.voidsetUseMap.voidsetValue.voidsetValueAsNumber(double valueAsNumber) setValueAsNumber.voidsetWidth(double width) setWidth.voidstepDown()stepDown.voidstepDown(double n) Decrements a range input control's value by the value given by the Step attribute.voidstepUp()stepUp.voidstepUp(double n) Increments a range input control's value by the value given by the Step attribute.Methods inherited from interface org.loboevolution.html.node.Element
closest, getAttribute, getAttributeNames, getAttributeNode, getAttributeNodeNS, getAttributeNS, getBoundingClientRect, getClassList, getClassName, getClientHeight, getClientLeft, getClientRects, getClientTop, getClientWidth, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getId, getInnerHTML, getLocalName, getNamespaceURI, getOuterHTML, getPrefix, getSchemaTypeInfo, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getSlot, getTagName, hasAttribute, hasAttributeNS, hasPointerCapture, insertAdjacentElement, insertAdjacentHTML, matches, releasePointerCapture, removeAttribute, removeAttributeNode, removeAttributeNS, requestPointerLock, scroll, scrollBy, scrollIntoView, scrollIntoView, scrollTo, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, setId, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOuterHTML, setPointerCapture, setScrollLeft, setScrollTop, setSlot, toggleAttribute, toggleAttributeMethods inherited from interface org.loboevolution.events.EventTarget
addEventListener, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, removeEventListenerMethods inherited from interface org.loboevolution.html.dom.HTMLElement
click, getAccessKey, getAccessKeyLabel, getAutocapitalize, getContentEditable, getCurrentStyle, getDir, getInnerText, getLang, getOffsetHeight, getOffsetLeft, getOffsetParent, getOffsetTop, getOffsetWidth, getStyle, getTitle, isDraggable, isHidden, isSpellcheck, isTranslate, setAccessKey, setAutocapitalize, setContentEditable, setDir, setDraggable, setHidden, setInnerText, setLang, setSpellcheck, setTitle, setTranslateMethods inherited from interface org.loboevolution.html.node.InnerHTML
setInnerHTMLMethods inherited from interface org.loboevolution.html.node.ModelNode
getDocumentItem, getFullURL, getParentModelNode, getRenderState, isEqualOrDescendentOf, setDocumentItem, warnMethods inherited from interface org.loboevolution.html.node.Node
appendChild, appendChildrenToCollectionImpl, cloneNode, cloneNode, compareDocumentPosition, contains, extractDescendentsArrayImpl, findUINode, forgetRenderState, getAttributes, getBaseURI, getChildNodes, getDocumentNode, getFeature, getFirstChild, getLastChild, getNextSibling, getNextTo, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, getPreviousTo, getRootNode, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isIsConnected, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, prepend, prependChild, removeChild, replaceChild, setNamespaceURI, setNodeValue, setOwnerDocument, setOwnerDocument, setParentImpl, setPrefix, setTextContent, setUserData, visitMethods inherited from interface org.loboevolution.html.node.NonDocumentTypeChildNode
getNextElementSibling, getPreviousElementSiblingMethods inherited from interface org.loboevolution.html.node.ParentNode
getChildElementCount, getChildren, getFirstElementChild, getLastElementChild, querySelector, querySelectorAll
-
Method Details
-
getAccept
String getAccept()Sets or retrieves a comma-separated list of content types.- Returns:
- a
Stringobject.
-
setAccept
setAccept.
- Parameters:
accept- aStringobject.
-
getAlign
Deprecated.Sets or retrieves how the object is aligned with adjacent text.- Returns:
- a
Stringobject.
-
setAlign
Deprecated.setAlign.
- Parameters:
align- aStringobject.
-
getAlt
String getAlt()Sets or retrieves a text alternative to the graphic.- Returns:
- a
Stringobject.
-
setAlt
setAlt.
- Parameters:
alt- aStringobject.
-
isAutocomplete
boolean isAutocomplete()Specifies whether autocomplete is applied to an editable text field.- Returns:
- a boolean.
-
setAutocomplete
setAutocomplete.
- Parameters:
autocomplete- aStringobject.
-
isAutofocus
boolean isAutofocus()Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.- Returns:
- a boolean.
-
setAutofocus
void setAutofocus(boolean autofocus) setAutofocus.
- Parameters:
autofocus- a boolean.
-
isChecked
boolean isChecked()Sets or retrieves the state of the check box or radio button.- Returns:
- a boolean.
-
setChecked
void setChecked(boolean checked) setChecked.
- Parameters:
checked- a boolean.
-
isDefaultChecked
boolean isDefaultChecked()Sets or retrieves the state of the check box or radio button.- Returns:
- a boolean.
-
setDefaultChecked
void setDefaultChecked(boolean defaultChecked) setDefaultChecked.
- Parameters:
defaultChecked- a boolean.
-
getDefaultValue
String getDefaultValue()Sets or retrieves the initial contents of the object.- Returns:
- a
Stringobject.
-
setDefaultValue
setDefaultValue.
- Parameters:
defaultValue- aStringobject.
-
getDirName
String getDirName()getDirName.
- Returns:
- a
Stringobject.
-
setDirName
setDirName.
- Parameters:
dirName- aStringobject.
-
isDisabled
boolean isDisabled()isDisabled.
- Returns:
- a boolean.
-
setDisabled
void setDisabled(boolean disabled) setDisabled.
- Parameters:
disabled- a boolean.
-
getForm
HTMLFormElement getForm()Retrieves a reference to the form that the object is embedded in.- Returns:
- a
HTMLFormElementobject.
-
getFormAction
String getFormAction()Overrides the action attribute (where the data on a form is sent) on the parent form element.- Returns:
- a
Stringobject.
-
setFormAction
setFormAction.
- Parameters:
formAction- aStringobject.
-
getFormEnctype
String getFormEnctype()Used to override the encoding (formEnctype attribute) specified on the form element.- Returns:
- a
Stringobject.
-
setFormEnctype
setFormEnctype.
- Parameters:
formEnctype- aStringobject.
-
getFormMethod
String getFormMethod()Overrides the submit method attribute previously specified on a form element.- Returns:
- a
Stringobject.
-
setFormMethod
setFormMethod.
- Parameters:
formMethod- aStringobject.
-
isFormNoValidate
boolean isFormNoValidate()Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option.- Returns:
- a boolean.
-
setFormNoValidate
void setFormNoValidate(boolean formNoValidate) setFormNoValidate.
- Parameters:
formNoValidate- a boolean.
-
getFormTarget
String getFormTarget()Overrides the target attribute on a form element.- Returns:
- a
Stringobject.
-
setFormTarget
setFormTarget.
- Parameters:
formTarget- aStringobject.
-
getHeight
double getHeight()Sets or retrieves the height of the object.- Returns:
- a double.
-
setHeight
void setHeight(double height) setHeight.
- Parameters:
height- a double.
-
isIndeterminate
boolean isIndeterminate()isIndeterminate.
- Returns:
- a boolean.
-
setIndeterminate
void setIndeterminate(boolean indeterminate) setIndeterminate.
- Parameters:
indeterminate- a boolean.
-
getLabels
NodeList getLabels()getLabels.
- Returns:
- a
NodeListobject.
-
getList
HTMLElement getList()Specifies the ID of a pre-defined datalist of options for an input element.- Returns:
- a
HTMLElementobject.
-
getMax
String getMax()Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.- Returns:
- a
Stringobject.
-
setMax
setMax.
- Parameters:
max- aStringobject.
-
getMaxLength
int getMaxLength()Sets or retrieves the maximum number of characters that the user can enter in a text control.- Returns:
- a
Integerobject.
-
setMaxLength
void setMaxLength(int maxLength) setMaxLength.
- Parameters:
maxLength- aIntegerobject.
-
getMin
String getMin()Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field.- Returns:
- a
Stringobject.
-
setMin
setMin.
- Parameters:
min- aStringobject.
-
getMinLength
int getMinLength()getMinLength.
- Returns:
- a
Integerobject.
-
setMinLength
void setMinLength(int minLength) setMinLength.
- Parameters:
minLength- aIntegerobject.
-
isMultiple
boolean isMultiple()Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.- Returns:
- a boolean.
-
setMultiple
void setMultiple(boolean multiple) setMultiple.
- Parameters:
multiple- a boolean.
-
getName
String getName()Sets or retrieves the name of the object.- Returns:
- a
Stringobject.
-
setName
setName.
- Parameters:
name- aStringobject.
-
getPattern
String getPattern()Gets or sets a string containing a regular expression that the user's input must match.- Returns:
- a
Stringobject.
-
setPattern
setPattern.
- Parameters:
pattern- aStringobject.
-
getPlaceholder
String getPlaceholder()Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.- Returns:
- a
Stringobject.
-
setPlaceholder
setPlaceholder.
- Parameters:
placeholder- aStringobject.
-
isReadOnly
boolean isReadOnly()isReadOnly.
- Returns:
- a boolean.
-
setReadOnly
void setReadOnly(boolean readOnly) setReadOnly.
- Parameters:
readOnly- a boolean.
-
isRequired
boolean isRequired()When present, marks an element that can't be submitted without a value.- Returns:
- a boolean.
-
setRequired
void setRequired(boolean required) setRequired.
- Parameters:
required- a boolean.
-
getSelectionDirection
String getSelectionDirection()getSelectionDirection.
- Returns:
- a
Stringobject.
-
setSelectionDirection
setSelectionDirection.
- Parameters:
selectionDirection- aStringobject.
-
getSelectionEnd
int getSelectionEnd()Gets or sets the end position or offset of a text selection.- Returns:
- a
Integerobject.
-
setSelectionEnd
void setSelectionEnd(int selectionEnd) setSelectionEnd.
- Parameters:
selectionEnd- aIntegerobject.
-
getSelectionStart
int getSelectionStart()Gets or sets the starting position or offset of a text selection.- Returns:
- a
Integerobject.
-
setSelectionStart
void setSelectionStart(int selectionStart) setSelectionStart.
- Parameters:
selectionStart- aIntegerobject.
-
getSize
int getSize()getSize.
- Returns:
- a
Integerobject.
-
setSize
void setSize(int size) setSize.
- Parameters:
size- aIntegerobject.
-
getSrc
String getSrc()The address or URL of the a media resource that is to be considered.- Returns:
- a
Stringobject.
-
setSrc
setSrc.
- Parameters:
src- aStringobject.
-
getStep
String getStep()Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.- Returns:
- a
Stringobject.
-
setStep
setStep.
- Parameters:
step- aStringobject.
-
getType
String getType()Returns the content type of the object.- Returns:
- a
Stringobject.
-
setType
setType.
- Parameters:
type- aStringobject.
-
getUseMap
Deprecated.Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.- Returns:
- a
Stringobject.
-
setUseMap
setUseMap.
- Parameters:
useMap- aStringobject.
-
getValidationMessage
String getValidationMessage()Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.- Returns:
- a
Stringobject.
-
getValidity
ValidityState getValidity()Returns a ValidityState object that represents the validity states of an element.- Returns:
- a
ValidityStateobject.
-
getValue
String getValue()Returns the value of the data at the cursor's current position.- Returns:
- a
Stringobject.
-
setValue
setValue.
- Parameters:
value- aStringobject.
-
getValueAsNumber
double getValueAsNumber()Returns the input field value as a number.- Returns:
- a double.
-
setValueAsNumber
void setValueAsNumber(double valueAsNumber) setValueAsNumber.
- Parameters:
valueAsNumber- a double.
-
getWidth
double getWidth()Sets or retrieves the width of the object.- Returns:
- a double.
-
setWidth
void setWidth(double width) setWidth.
- Parameters:
width- a double.
-
isWillValidate
boolean isWillValidate()Returns whether an element will successfully validate based on forms validation rules and constraints.- Returns:
- a boolean.
-
checkValidity
boolean checkValidity()Returns whether a form will validate when it is submitted, without having to submit it.- Returns:
- a boolean.
-
reportValidity
boolean reportValidity()reportValidity.
- Returns:
- a boolean.
-
select
void select()Makes the selection equal to the current object. -
setCustomValidity
Sets a custom error message that is displayed when a form is submitted.- Parameters:
error- Sets a custom error message that is displayed when a form is submitted.
-
setRangeText
setRangeText.
- Parameters:
replacement- aStringobject.
-
setRangeText
setRangeText.
-
setRangeText
setRangeText.
-
setSelectionRange
Sets the start and end positions of a selection in a text field.- Parameters:
start- The offset into the text field for the start of the selection.end- The offset into the text field for the end of the selection.direction- The direction in which the selection is performed.
-
setSelectionRange
void setSelectionRange(int start, int end) setSelectionRange.
-
stepDown
void stepDown(double n) Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.- Parameters:
n- Value to decrement the value by.
-
stepDown
void stepDown()stepDown.
-
stepUp
void stepUp(double n) Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value.- Parameters:
n- Value to increment the value by.
-
stepUp
void stepUp()stepUp.
-