1 /* 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 9 * PURPOSE. 10 * See W3C License http://www.w3.org/Consortium/Legal/ for more details. 11 */ 12 13 package org.w3c.dom.html2; 14 15 /** 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>. 21 */ 22 public interface HTMLInputElement extends HTMLElement { 23 /** 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. 29 */ getDefaultValue()30 public String getDefaultValue(); 31 /** 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. 37 */ setDefaultValue(String defaultValue)38 public void setDefaultValue(String defaultValue); 39 40 /** 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. 46 */ getDefaultChecked()47 public boolean getDefaultChecked(); 48 /** 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. 54 */ setDefaultChecked(boolean defaultChecked)55 public void setDefaultChecked(boolean defaultChecked); 56 57 /** 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 60 * form. 61 */ getForm()62 public HTMLFormElement getForm(); 63 64 /** 65 * A comma-separated list of content types that a server processing this 66 * form will handle correctly. See the accept attribute definition in 67 * HTML 4.01. 68 */ getAccept()69 public String getAccept(); 70 /** 71 * A comma-separated list of content types that a server processing this 72 * form will handle correctly. See the accept attribute definition in 73 * HTML 4.01. 74 */ setAccept(String accept)75 public void setAccept(String accept); 76 77 /** 78 * A single character access key to give access to the form control. See 79 * the accesskey attribute definition in HTML 4.01. 80 */ getAccessKey()81 public String getAccessKey(); 82 /** 83 * A single character access key to give access to the form control. See 84 * the accesskey attribute definition in HTML 4.01. 85 */ setAccessKey(String accessKey)86 public void setAccessKey(String accessKey); 87 88 /** 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. 92 */ getAlign()93 public String getAlign(); 94 /** 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. 98 */ setAlign(String align)99 public void setAlign(String align); 100 101 /** 102 * Alternate text for user agents not rendering the normal content of this 103 * element. See the alt attribute definition in HTML 4.01. 104 */ getAlt()105 public String getAlt(); 106 /** 107 * Alternate text for user agents not rendering the normal content of this 108 * element. See the alt attribute definition in HTML 4.01. 109 */ setAlt(String alt)110 public void setAlt(String alt); 111 112 /** 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. 125 */ getChecked()126 public boolean getChecked(); 127 /** 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. 140 */ setChecked(boolean checked)141 public void setChecked(boolean checked); 142 143 /** 144 * The control is unavailable in this context. See the disabled attribute 145 * definition in HTML 4.01. 146 */ getDisabled()147 public boolean getDisabled(); 148 /** 149 * The control is unavailable in this context. See the disabled attribute 150 * definition in HTML 4.01. 151 */ setDisabled(boolean disabled)152 public void setDisabled(boolean disabled); 153 154 /** 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. 158 */ getMaxLength()159 public int getMaxLength(); 160 /** 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. 164 */ setMaxLength(int maxLength)165 public void setMaxLength(int maxLength); 166 167 /** 168 * Form control or object name when submitted with a form. See the name 169 * attribute definition in HTML 4.01. 170 */ getName()171 public String getName(); 172 /** 173 * Form control or object name when submitted with a form. See the name 174 * attribute definition in HTML 4.01. 175 */ setName(String name)176 public void setName(String name); 177 178 /** 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 181 * HTML 4.01. 182 */ getReadOnly()183 public boolean getReadOnly(); 184 /** 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 187 * HTML 4.01. 188 */ setReadOnly(boolean readOnly)189 public void setReadOnly(boolean readOnly); 190 191 /** 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 195 */ getSize()196 public int getSize(); 197 /** 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 201 */ setSize(int size)202 public void setSize(int size); 203 204 /** 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 208 * 4.01. 209 */ getSrc()210 public String getSrc(); 211 /** 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 215 * 4.01. 216 */ setSrc(String src)217 public void setSrc(String src); 218 219 /** 220 * Index that represents the element's position in the tabbing order. See 221 * the tabindex attribute definition in HTML 4.01. 222 */ getTabIndex()223 public int getTabIndex(); 224 /** 225 * Index that represents the element's position in the tabbing order. See 226 * the tabindex attribute definition in HTML 4.01. 227 */ setTabIndex(int tabIndex)228 public void setTabIndex(int tabIndex); 229 230 /** 231 * The type of control created (all lower case). See the type attribute 232 * definition in HTML 4.01. 233 * @version DOM Level 2 234 */ getType()235 public String getType(); 236 /** 237 * The type of control created (all lower case). See the type attribute 238 * definition in HTML 4.01. 239 * @version DOM Level 2 240 */ setType(String type)241 public void setType(String type); 242 243 /** 244 * Use client-side image map. See the usemap attribute definition in HTML 245 * 4.01. 246 */ getUseMap()247 public String getUseMap(); 248 /** 249 * Use client-side image map. See the usemap attribute definition in HTML 250 * 4.01. 251 */ setUseMap(String useMap)252 public void setUseMap(String useMap); 253 254 /** 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. 264 */ getValue()265 public String getValue(); 266 /** 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. 276 */ setValue(String value)277 public void setValue(String value); 278 279 /** 280 * Removes keyboard focus from this element. 281 */ blur()282 public void blur(); 283 284 /** 285 * Gives keyboard focus to this element. 286 */ focus()287 public void focus(); 288 289 /** 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". 293 */ select()294 public void select(); 295 296 /** 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". 300 */ click()301 public void click(); 302 303 } 304