action attribute | action property (Internet Explorer)

Switch View :
ScriptFree
action attribute | action property

[This documentation is preliminary and is subject to change.]

Sets or retrieves the URL to which the form content is sent for processing.

HTML 4.01 Specification, Section 17.3

Syntax

HTML<element action="p" ... >
JavaScript

p = object.action

Property values

Type: String

the URL to use. If a relative path is specified, the base URL of the document is assumed.

Standards information

Remarks

Windows Internet Explorer 8 or later. In IE8 Standards mode, the value of the action attribute depends on the context of the reference to the attribute. When read as a Document Object Model (DOM) attribute, action returns an absolute URL. The value specified by the page author is returned when action is read as a content attribute, when the page is displayed in an earlier document compatibility mode, or when the page is viewed with an earlier version of the browser. For more information, see Attribute Differences in Internet Explorer 8.

The value of the action attribute depends on the context of the reference to the attribute. When read as a DOM attribute, action returns an absolute URL. The value specified by the page author is returned when action is read as a content attribute.

Examples

This example uses the ACTION attribute to post a form to a specified URL.


<HTML>
   <FORM ACTION="http://example.microsoft.com/sample.asp" 
      METHOD="POST">
      Enter your name: <INPUT NAME="FName"><BR>
      Favorite Ice Cream Flavor:
      <SELECT NAME="Flavor">
         <OPTION VALUE="Chocolate">Chocolate
         <OPTION VALUE="Strawberry">Strawberry
         <OPTION VALUE="Vanilla" SELECTED>Vanilla
      </SELECT>
      <P><INPUT TYPE=SUBMIT>
   </FORM>
</HTML>

This example uses the ACTION attribute to specify a URL for the mailto protocol.


<form ACTION="mailto:sales@widgets.com" method=GET>
  <input name=subject type=hidden 
     value="Widget%20Product%20Information%20Request">
  Enter your full mailing address<BR>
  <TextArea name=body cols=40></textarea>
  <input type=submit value="Send Request"
</form>

 

 

Build date: 3/8/2012