What is the importance of "method" attribute in a html form?

<form action="form_action.asp" method="get" name="myForm">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="button" onclick="formSubmit()" value="Send form data!">
</form>

Postaserver
 
The method attribute tells the server how to submit the form information. There are two methods, get and post. The default method is get.

method="get"

This sends the form information by including it on the URL. The get method sends the information to the server in one step. It is best used for forms where the information is not secure (as it can be seen in the URL), and the amount of information passed is small.
 
<form action="form_action.asp" method="get" name="myForm">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="button" onclick="formSubmit()" value="Send form data!">
</form> as already mentioned, but look here a lot of interesting, though.
 
Back
Top