2 * Copyright (c) 2003 World Wide Web Consortium,
3 * (Massachusetts Institute of Technology, Institut National de
4 * Recherche en Informatique et en Automatique, Keio University). All
5 * Rights Reserved. This program is distributed under the W3C's Software
6 * Intellectual Property License. This program is distributed in the
7 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
13 package org
.w3c
.dom
.html2
;
16 * Form control.Depending upon the environment in which the page is being
17 * viewed, the value property may be read-only for the file upload input
18 * type. For the "password" input type, the actual value returned may be
19 * masked to prevent unauthorized use. See the INPUT element definition in [<a href='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>].
20 * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
22 public interface HTMLInputElement
extends HTMLElement
{
24 * When the <code>type</code> attribute of the element has the value
25 * "text", "file" or "password", this represents the HTML value
26 * attribute of the element. The value of this attribute does not change
27 * if the contents of the corresponding form control, in an interactive
28 * user agent, changes. See the value attribute definition in HTML 4.01.
30 public String
getDefaultValue();
32 * When the <code>type</code> attribute of the element has the value
33 * "text", "file" or "password", this represents the HTML value
34 * attribute of the element. The value of this attribute does not change
35 * if the contents of the corresponding form control, in an interactive
36 * user agent, changes. See the value attribute definition in HTML 4.01.
38 public void setDefaultValue(String defaultValue
);
41 * When <code>type</code> has the value "radio" or "checkbox", this
42 * represents the HTML checked attribute of the element. The value of
43 * this attribute does not change if the state of the corresponding form
44 * control, in an interactive user agent, changes. See the checked
45 * attribute definition in HTML 4.01.
47 public boolean getDefaultChecked();
49 * When <code>type</code> has the value "radio" or "checkbox", this
50 * represents the HTML checked attribute of the element. The value of
51 * this attribute does not change if the state of the corresponding form
52 * control, in an interactive user agent, changes. See the checked
53 * attribute definition in HTML 4.01.
55 public void setDefaultChecked(boolean defaultChecked
);
58 * Returns the <code>FORM</code> element containing this control. Returns
59 * <code>null</code> if this control is not within the context of a
62 public HTMLFormElement
getForm();
65 * A comma-separated list of content types that a server processing this
66 * form will handle correctly. See the accept attribute definition in
69 public String
getAccept();
71 * A comma-separated list of content types that a server processing this
72 * form will handle correctly. See the accept attribute definition in
75 public void setAccept(String accept
);
78 * A single character access key to give access to the form control. See
79 * the accesskey attribute definition in HTML 4.01.
81 public String
getAccessKey();
83 * A single character access key to give access to the form control. See
84 * the accesskey attribute definition in HTML 4.01.
86 public void setAccessKey(String accessKey
);
89 * Aligns this object (vertically or horizontally) with respect to its
90 * surrounding text. See the align attribute definition in HTML 4.01.
91 * This attribute is deprecated in HTML 4.01.
93 public String
getAlign();
95 * Aligns this object (vertically or horizontally) with respect to its
96 * surrounding text. See the align attribute definition in HTML 4.01.
97 * This attribute is deprecated in HTML 4.01.
99 public void setAlign(String align
);
102 * Alternate text for user agents not rendering the normal content of this
103 * element. See the alt attribute definition in HTML 4.01.
105 public String
getAlt();
107 * Alternate text for user agents not rendering the normal content of this
108 * element. See the alt attribute definition in HTML 4.01.
110 public void setAlt(String alt
);
113 * When the <code>type</code> attribute of the element has the value
114 * "radio" or "checkbox", this represents the current state of the form
115 * control, in an interactive user agent. Changes to this attribute
116 * change the state of the form control, but do not change the value of
117 * the HTML checked attribute of the INPUT element.During the handling
118 * of a click event on an input element with a type attribute that has
119 * the value "radio" or "checkbox", some implementations may change the
120 * value of this property before the event is being dispatched in the
121 * document. If the default action of the event is canceled, the value
122 * of the property may be changed back to its original value. This means
123 * that the value of this property during the handling of click events
124 * is implementation dependent.
126 public boolean getChecked();
128 * When the <code>type</code> attribute of the element has the value
129 * "radio" or "checkbox", this represents the current state of the form
130 * control, in an interactive user agent. Changes to this attribute
131 * change the state of the form control, but do not change the value of
132 * the HTML checked attribute of the INPUT element.During the handling
133 * of a click event on an input element with a type attribute that has
134 * the value "radio" or "checkbox", some implementations may change the
135 * value of this property before the event is being dispatched in the
136 * document. If the default action of the event is canceled, the value
137 * of the property may be changed back to its original value. This means
138 * that the value of this property during the handling of click events
139 * is implementation dependent.
141 public void setChecked(boolean checked
);
144 * The control is unavailable in this context. See the disabled attribute
145 * definition in HTML 4.01.
147 public boolean getDisabled();
149 * The control is unavailable in this context. See the disabled attribute
150 * definition in HTML 4.01.
152 public void setDisabled(boolean disabled
);
155 * Maximum number of characters for text fields, when <code>type</code>
156 * has the value "text" or "password". See the maxlength attribute
157 * definition in HTML 4.01.
159 public int getMaxLength();
161 * Maximum number of characters for text fields, when <code>type</code>
162 * has the value "text" or "password". See the maxlength attribute
163 * definition in HTML 4.01.
165 public void setMaxLength(int maxLength
);
168 * Form control or object name when submitted with a form. See the name
169 * attribute definition in HTML 4.01.
171 public String
getName();
173 * Form control or object name when submitted with a form. See the name
174 * attribute definition in HTML 4.01.
176 public void setName(String name
);
179 * This control is read-only. Relevant only when <code>type</code> has the
180 * value "text" or "password". See the readonly attribute definition in
183 public boolean getReadOnly();
185 * This control is read-only. Relevant only when <code>type</code> has the
186 * value "text" or "password". See the readonly attribute definition in
189 public void setReadOnly(boolean readOnly
);
192 * Size information. The precise meaning is specific to each type of
193 * field. See the size attribute definition in HTML 4.01.
194 * @version DOM Level 2
196 public int getSize();
198 * Size information. The precise meaning is specific to each type of
199 * field. See the size attribute definition in HTML 4.01.
200 * @version DOM Level 2
202 public void setSize(int size
);
205 * When the <code>type</code> attribute has the value "image", this
206 * attribute specifies the location of the image to be used to decorate
207 * the graphical submit button. See the src attribute definition in HTML
210 public String
getSrc();
212 * When the <code>type</code> attribute has the value "image", this
213 * attribute specifies the location of the image to be used to decorate
214 * the graphical submit button. See the src attribute definition in HTML
217 public void setSrc(String src
);
220 * Index that represents the element's position in the tabbing order. See
221 * the tabindex attribute definition in HTML 4.01.
223 public int getTabIndex();
225 * Index that represents the element's position in the tabbing order. See
226 * the tabindex attribute definition in HTML 4.01.
228 public void setTabIndex(int tabIndex
);
231 * The type of control created (all lower case). See the type attribute
232 * definition in HTML 4.01.
233 * @version DOM Level 2
235 public String
getType();
237 * The type of control created (all lower case). See the type attribute
238 * definition in HTML 4.01.
239 * @version DOM Level 2
241 public void setType(String type
);
244 * Use client-side image map. See the usemap attribute definition in HTML
247 public String
getUseMap();
249 * Use client-side image map. See the usemap attribute definition in HTML
252 public void setUseMap(String useMap
);
255 * When the <code>type</code> attribute of the element has the value
256 * "text", "file" or "password", this represents the current contents of
257 * the corresponding form control, in an interactive user agent.
258 * Changing this attribute changes the contents of the form control, but
259 * does not change the value of the HTML value attribute of the element.
260 * When the <code>type</code> attribute of the element has the value
261 * "button", "hidden", "submit", "reset", "image", "checkbox" or
262 * "radio", this represents the HTML value attribute of the element. See
263 * the value attribute definition in HTML 4.01.
265 public String
getValue();
267 * When the <code>type</code> attribute of the element has the value
268 * "text", "file" or "password", this represents the current contents of
269 * the corresponding form control, in an interactive user agent.
270 * Changing this attribute changes the contents of the form control, but
271 * does not change the value of the HTML value attribute of the element.
272 * When the <code>type</code> attribute of the element has the value
273 * "button", "hidden", "submit", "reset", "image", "checkbox" or
274 * "radio", this represents the HTML value attribute of the element. See
275 * the value attribute definition in HTML 4.01.
277 public void setValue(String value
);
280 * Removes keyboard focus from this element.
285 * Gives keyboard focus to this element.
290 * Select the contents of the text area. For <code>INPUT</code> elements
291 * whose <code>type</code> attribute has one of the following values:
292 * "text", "file", or "password".
294 public void select();
297 * Simulate a mouse-click. For <code>INPUT</code> elements whose
298 * <code>type</code> attribute has one of the following values:
299 * "button", "checkbox", "radio", "reset", or "submit".