001/*
002 * Copyright (c) 2003 World Wide Web Consortium,
003 * (Massachusetts Institute of Technology, Institut National de
004 * Recherche en Informatique et en Automatique, Keio University). All
005 * Rights Reserved. This program is distributed under the W3C's Software
006 * Intellectual Property License. This program is distributed in the
007 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009 * PURPOSE.
010 * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011 */
012
013package org.w3c.dom.html2;
014
015/**
016 * The <code>FORM</code> element encompasses behavior similar to a collection
017 * and an element. It provides direct access to the contained form controls
018 * as well as the attributes of the form element. See the FORM element
019 * definition in HTML 4.01.
020 * <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>.
021 */
022public interface HTMLFormElement extends HTMLElement {
023    /**
024     * Returns a collection of all form control elements in the form.
025     */
026    public HTMLCollection getElements();
027
028    /**
029     * The number of form controls in the form.
030     */
031    public int getLength();
032
033    /**
034     * Names the form.
035     */
036    public String getName();
037    /**
038     * Names the form.
039     */
040    public void setName(String name);
041
042    /**
043     * List of character sets supported by the server. See the accept-charset
044     * attribute definition in HTML 4.01.
045     */
046    public String getAcceptCharset();
047    /**
048     * List of character sets supported by the server. See the accept-charset
049     * attribute definition in HTML 4.01.
050     */
051    public void setAcceptCharset(String acceptCharset);
052
053    /**
054     * Server-side form handler. See the action attribute definition in HTML
055     * 4.01.
056     */
057    public String getAction();
058    /**
059     * Server-side form handler. See the action attribute definition in HTML
060     * 4.01.
061     */
062    public void setAction(String action);
063
064    /**
065     * The content type of the submitted form, generally
066     * "application/x-www-form-urlencoded". See the enctype attribute
067     * definition in HTML 4.01. The onsubmit even handler is not guaranteed
068     * to be triggered when invoking this method. The behavior is
069     * inconsistent for historical reasons and authors should not rely on a
070     * particular one.
071     */
072    public String getEnctype();
073    /**
074     * The content type of the submitted form, generally
075     * "application/x-www-form-urlencoded". See the enctype attribute
076     * definition in HTML 4.01. The onsubmit even handler is not guaranteed
077     * to be triggered when invoking this method. The behavior is
078     * inconsistent for historical reasons and authors should not rely on a
079     * particular one.
080     */
081    public void setEnctype(String enctype);
082
083    /**
084     * HTTP method [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>] used to submit form. See the method attribute definition
085     * in HTML 4.01.
086     */
087    public String getMethod();
088    /**
089     * HTTP method [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>] used to submit form. See the method attribute definition
090     * in HTML 4.01.
091     */
092    public void setMethod(String method);
093
094    /**
095     * Frame to render the resource in. See the target attribute definition in
096     * HTML 4.01.
097     */
098    public String getTarget();
099    /**
100     * Frame to render the resource in. See the target attribute definition in
101     * HTML 4.01.
102     */
103    public void setTarget(String target);
104
105    /**
106     * Submits the form. It performs the same action as a submit button.
107     */
108    public void submit();
109
110    /**
111     * Restores a form element's default values. It performs the same action
112     * as a reset button.
113     */
114    public void reset();
115
116}