asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Authoring Your Web Pages > Using Forms

Using Forms

Previous: Frames and Framesets


Form Attributes

The FORM element takes several attributes, the more important of which are the action and method attributes. These are used to specify the destination of the data, and how the data in the form controls is to be delivered.

The action attribute specifies the form processing agent, which can be:

  • any valid HTTP URI, to submit the form to a program. This URI typically points to a file that defines a script designed to process the delivered information to the server. The script may or may not return results back to the client.
  • or a mailto URI, to submit the form via email.

The method attribute specifies the HTTP form submission method used to send the form to the processing agent. It may take one of two possible values:

  • GET specifies that the form data set is appended to the URI specified in the ACTION attribute, with a question-mark (?) as separator, and the new URI sent to the processing agent.
  • POST specifies that the form data set is included in the body of the form and sent to the processing agent.

The following example shows a form that is to be processed by the "adduser" program when submitted. The form will be sent to the program using the HTTP "post" method.

<form action="http://somewhere.com/adduser" method="post">
   ... form contents ...
</form>

The next example shows how to send a submitted form to an email address:

<form action="mailto:someone@somewhere.com" method="post">
   ... form contents ...
</form>

For more information applicable to HTML forms, please refer to the FORM element in the HTML Reference.


More ...
Back to top


© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note