The reason for this is the meaning for GET and POST of the attribute method of the form tag:
- GET :
- All data of the submitted form will be encoded as URL parameters
- POST :
- All data of the submitted form will be sent in the request header
That implies when you set the method to
GET the field
am with a value of "submit" will be sent in the parameters attached to the URL. If the method is set to
POST the field names and values will be sent in the request header and thus the url will not have to be modified.
There actually is no reason to try what you did though. If you want some additional parameter to be submitted with the other form data you can just include a hidden field:
<input type="hidden" name="f" value"sample" />
Field f will not be diplayed, but it will be sent in the request when the form is submitted.
And using method GET or POST will both yield the expected results.
Cheers and happy coding!
-MRB