reset

< dom‎ | events
Jump to: navigation, search



Overview Table

Synchronous No
Bubbles No
Target dom/Element
Cancelable No
Default action

Examples

View live exampleThis example demonstrates how to use the onreset event for a form object. Reset the form by clicking the first or second button. The only difference between the two buttons is that the second button invokes the reset method of the form object and the first button is of input type=reset. When either button is pressed the form is reset, resulting in the onreset event call on the form object. The onreset event calls an event handler which in turn adds the text Resetting form. to the text area below.

<HTML>
<HEAD>
<SCRIPT>
function doReset(){
    oTextArea1.innerText += "Resetting form.  ";
}
</SCRIPT>
</HEAD>
<BODY>
<FORM name="form1" onreset="doReset();"
    <B>Form</B><BR>
    style="border:2px solid #cccccc; background:#EEEEEE; padding:10px; ">
    <b>Enter some text:</b>
    <INPUT type="text" name="oText1" value=""><BR><BR>
    <INPUT TYPE="reset" value="Input type=reset"/>
    <BUTTON onclick="form.reset();">form.reset()</BUTTON>
</FORM>
<B>Form status</B><BR>
<SPAN id="oTextArea1" ></SPAN>
<BR><BR>
<BUTTON onclick="location.reload(true);">Refresh Page</BUTTON>
</BODY>
</HTML>

Notes

Remarks

Executes associated code. To invoke this event, do one of the following:

  • Click an input type=reset button.
  • Invoke the reset method of the form object.

The pEvtObj parameter is required for the following interfaces:

  • HTMLAnchorEvents2
  • HTMLAreaEvents2
  • HTMLButtonElementEvents2
  • HTMLControlElementEvents2
  • HTMLDocumentEvents2
  • HTMLElementEvents2
  • HTMLFormElementEvents2
  • HTMLImgEvents2
  • HTMLFrameSiteEvents2
  • HTMLInputFileElementEvents2
  • HTMLInputImageEvents2
  • HTMLInputTextElementEvents2
  • HTMLLabelEvents2
  • HTMLLinkElementEvents2
  • HTMLMapEvents2
  • HTMLMarqueeElementEvents2
  • HTMLObjectElementEvents2
  • HTMLOptionButtonElementEvents2
  • HTMLScriptEvents2
  • HTMLSelectElementEvents2
  • HTMLStyleElementEvents2
  • HTMLTableEvents2
  • HTMLTextContainerEvents2
  • HTMLWindowEvents2

Syntax

Standards information


Event handler parameters

pEvtObj [in]
Type: IHTMLEventObj

See also

Related pages (MSDN)

  • a
  • abbr
  • acronym
  • address
  • applet
  • area
  • audio
  • b
  • base
  • baseFont
  • bdo
  • bgSound
  • big
  • body
  • blockQuote
  • br
  • button
  • canvas
  • caption
  • center
  • cite
  • code
  • col
  • colGroup
  • comment
  • custom
  • dd
  • del
  • dfn
  • dir
  • div
  • dl
  • document
  • dt
  • em
  • embed
  • fieldSet
  • font
  • form
  • frame
  • frameSet
  • head
  • hn
  • hr
  • html
  • i
  • iframe
  • img
  • input type=button
  • input type=checkbox
  • input type=file
  • input type=hidden
  • input type=image
  • input type=password
  • input type=radio
  • input type=reset
  • input type=submit
  • input type=text
  • ins
  • isIndex
  • kbd
  • label
  • legend
  • li
  • link
  • listing
  • map
  • marquee
  • media
  • menu
  • meta
  • nextID
  • noBR
  • noFrames
  • noScript
  • object
  • ol
  • optGroup
  • option
  • p
  • param
  • plainText
  • pre
  • q
  • rt
  • ruby
  • s
  • samp
  • script
  • select
  • small
  • source
  • span
  • strike
  • strong
  • style
  • sub
  • sup
  • table
  • tBody
  • td
  • textArea
  • tFoot
  • th
  • tHead
  • title
  • tr
  • tt
  • u
  • ul
  • var
  • wbr
  • video
  • window
  • xmp
  • reset

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]