Page 304 - DCAP109_GRAPHIC_TOOLS
P. 304

Unit 13: Dreamweaver – Forms and Media Elements




          To let the browser know where to send the content we add these properties to the <form> tag:  Notes
          z    Action: the address to redirect out page to after the form is submitted
          z    Method: It can take up two values, post or get
          The address is the URL of the CGI script the content should be sent to. The post and get methods
          are simply two different methods for submitting data to the script. If we use the get method, it
          appends the data to the URL making it unsafe to carry sensitive information. Unlike get, post
          method is more secure and can carry large amount of data too.
          Syntax:
          <form method=”post” action=”http://www.abc.com”>
          <!— Here goes form fields and HTML —>

          </form>
          The most important form element is the <input> element. The <input> element is used to select
          user information. An <input> element can vary in many ways, depending on the type attribute.
          An <input> element can be of type text field, checkbox, password, radio button, submit button,
          and more.


                 Example:
          <form>
          First name: <input type=”text” name=”firstname”><br>
          Last name: <input type=”text” name=”lastname”>

          </form>
          The above code creates a one-line input field that a user can enter text into.



             Did u know? The default width of a text field is 20 characters.
          The name attribute identifies the control. In the example above, name is assigned a value of
          “lastname”. Information input by the user in a control, such as a text field, is sent to the server
          along with the value of that control’s name attribute. The message sent to the server would
          include the following string:

          Last name=abc
          Servers send all the information from a form in one long text string to whatever program or
          address is specified in the action attribute. It’s up to the program or the recipient of the form
          message to parse the string.
          lastname=abc&address=a.bc@gmail.com&comment=Age%21
          As you can see, the various fields are separated by ampersands (&), and the individual words
          within the responses are separated by plus signs. Most non-alphanumeric characters such as the
          exclamation mark in the example are represented by their hexadecimal values. Decoding this
          text string is called parsing the response.











                                           LOVELY PROFESSIONAL UNIVERSITY                                   297
   299   300   301   302   303   304   305   306   307   308   309