1. /*
  2. * Copyright (c) 2000 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. See W3C License http://www.w3.org/Consortium/Legal/ for more
  10. * details.
  11. */
  12. package org.w3c.dom.html;
  13. /**
  14. * Form control. Note. Depending upon the environment in which the page is
  15. * being viewed, the value property may be read-only for the file upload
  16. * input type. For the "password" input type, the actual value returned may
  17. * be masked to prevent unauthorized use. See the INPUT element definition
  18. * in HTML 4.0.
  19. * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
  20. */
  21. public interface HTMLInputElement extends HTMLElement {
  22. /**
  23. * When the <code>type</code> attribute of the element has the value
  24. * "Text", "File" or "Password", this represents the HTML value attribute
  25. * of the element. The value of this attribute does not change if the
  26. * contents of the corresponding form control, in an interactive user
  27. * agent, changes. Changing this attribute, however, resets the contents
  28. * of the form control. See the value attribute definition in HTML 4.0.
  29. */
  30. public String getDefaultValue();
  31. public void setDefaultValue(String defaultValue);
  32. /**
  33. * When <code>type</code> has the value "Radio" or "Checkbox", this
  34. * represents the HTML checked attribute of the element. The value of
  35. * this attribute does not change if the state of the corresponding form
  36. * control, in an interactive user agent, changes. Changes to this
  37. * attribute, however, resets the state of the form control. See the
  38. * checked attribute definition in HTML 4.0.
  39. */
  40. public boolean getDefaultChecked();
  41. public void setDefaultChecked(boolean defaultChecked);
  42. /**
  43. * Returns the <code>FORM</code> element containing this control. Returns
  44. * <code>null</code> if this control is not within the context of a form.
  45. */
  46. public HTMLFormElement getForm();
  47. /**
  48. * A comma-separated list of content types that a server processing this
  49. * form will handle correctly. See the accept attribute definition in
  50. * HTML 4.0.
  51. */
  52. public String getAccept();
  53. public void setAccept(String accept);
  54. /**
  55. * A single character access key to give access to the form control. See
  56. * the accesskey attribute definition in HTML 4.0.
  57. */
  58. public String getAccessKey();
  59. public void setAccessKey(String accessKey);
  60. /**
  61. * Aligns this object (vertically or horizontally) with respect to its
  62. * surrounding text. See the align attribute definition in HTML 4.0.
  63. * This attribute is deprecated in HTML 4.0.
  64. */
  65. public String getAlign();
  66. public void setAlign(String align);
  67. /**
  68. * Alternate text for user agents not rendering the normal content of
  69. * this element. See the alt attribute definition in HTML 4.0.
  70. */
  71. public String getAlt();
  72. public void setAlt(String alt);
  73. /**
  74. * When the <code>type</code> attribute of the element has the value
  75. * "Radio" or "Checkbox", this represents the current state of the form
  76. * control, in an interactive user agent. Changes to this attribute
  77. * change the state of the form control, but do not change the value of
  78. * the HTML value attribute of the element.
  79. */
  80. public boolean getChecked();
  81. public void setChecked(boolean checked);
  82. /**
  83. * The control is unavailable in this context. See the disabled
  84. * attribute definition in HTML 4.0.
  85. */
  86. public boolean getDisabled();
  87. public void setDisabled(boolean disabled);
  88. /**
  89. * Maximum number of characters for text fields, when <code>type</code>
  90. * has the value "Text" or "Password". See the maxlength attribute
  91. * definition in HTML 4.0.
  92. */
  93. public int getMaxLength();
  94. public void setMaxLength(int maxLength);
  95. /**
  96. * Form control or object name when submitted with a form. See the name
  97. * attribute definition in HTML 4.0.
  98. */
  99. public String getName();
  100. public void setName(String name);
  101. /**
  102. * This control is read-only. Relevant only when <code>type</code> has
  103. * the value "Text" or "Password". See the readonly attribute definition
  104. * in HTML 4.0.
  105. */
  106. public boolean getReadOnly();
  107. public void setReadOnly(boolean readOnly);
  108. /**
  109. * Size information. The precise meaning is specific to each type of
  110. * field. See the size attribute definition in HTML 4.0.
  111. */
  112. public String getSize();
  113. public void setSize(String size);
  114. /**
  115. * When the <code>type</code> attribute has the value "Image", this
  116. * attribute specifies the location of the image to be used to decorate
  117. * the graphical submit button. See the src attribute definition in HTML
  118. * 4.0.
  119. */
  120. public String getSrc();
  121. public void setSrc(String src);
  122. /**
  123. * Index that represents the element's position in the tabbing order. See
  124. * the tabindex attribute definition in HTML 4.0.
  125. */
  126. public int getTabIndex();
  127. public void setTabIndex(int tabIndex);
  128. /**
  129. * The type of control created. See the type attribute definition in
  130. * HTML 4.0.
  131. */
  132. public String getType();
  133. /**
  134. * Use client-side image map. See the usemap attribute definition in
  135. * HTML 4.0.
  136. */
  137. public String getUseMap();
  138. public void setUseMap(String useMap);
  139. /**
  140. * When the <code>type</code> attribute of the element has the value
  141. * "Text", "File" or "Password", this represents the current contents of
  142. * the corresponding form control, in an interactive user agent. Changing
  143. * this attribute changes the contents of the form control, but does not
  144. * change the value of the HTML value attribute of the element. When the
  145. * <code>type</code> attribute of the element has the value "Button",
  146. * "Hidden", "Submit", "Reset", "Image", "Checkbox" or "Radio", this
  147. * represents the HTML value attribute of the element. See the value
  148. * attribute definition in HTML 4.0.
  149. */
  150. public String getValue();
  151. public void setValue(String value);
  152. /**
  153. * Removes keyboard focus from this element.
  154. */
  155. public void blur();
  156. /**
  157. * Gives keyboard focus to this element.
  158. */
  159. public void focus();
  160. /**
  161. * Select the contents of the text area. For <code>INPUT</code> elements
  162. * whose <code>type</code> attribute has one of the following values:
  163. * "Text", "File", or "Password".
  164. */
  165. public void select();
  166. /**
  167. * Simulate a mouse-click. For <code>INPUT</code> elements whose
  168. * <code>type</code> attribute has one of the following values: "Button",
  169. * "Checkbox", "Radio", "Reset", or "Submit".
  170. */
  171. public void click();
  172. }