Form.method

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

							form.method

Description

The method property of the Form object represents the type of submission, GET or POST, being used by the form.

Example

In Listing 7.261, the method property is used to get the type of method being used by the form. The informMethod() function alerts the user of the method, GET or POST, being used by the form.

Listing 7.261 Accessing Method Object
<html>
<head>
<title> Using the method property of the Form object</title>
</head>
<body>
<script language="JavaScript">
<!--Hide

function informMethod(){
alert("The form method is:" + document.form1.method);
}
// End Hide --->
</script>
							 <form name="form1" method="get"> First Name:<input type=text" ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.