HTML DOM action Property
Complete Form Object Reference
Definition and Usage
The action property sets or returns the action attribute of a form.
The action attribute defines where to send the data when the form is
submitted.
Syntax
Example
The following example changes the action URL of a form:
<html>
<head>
<script type="text/javascript">
function changeAction()
{
var x=document.getElementById("myForm")
alert("Original action: " + x.action)
x.action="default.asp"
alert("New action: " + x.action)
x.submit()
}
</script>
</head>
<body>
<form id="myForm" action="js_examples.asp">
Name: <input type="text" value="Mickey Mouse" />
<input type="button" onclick="changeAction()"
value="Change action attribute and submit form" />
</form>
</body>
</html>
|
Try-It-Yourself Demos
Change
the action attribute of a form
Complete Form Object Reference
Learn XML with <oXygen/> XML Editor - Free Trial!
|
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|