Handbook of Computer Science(cs) and IT

HTML Form

Forms not only provide communication from user to server, but also provide powerful stuff and can add a lot of value to the web pages.

 

Forms are used to get inputs from the user. The user input is submitted to the server. A form is defined with <form>……</form> tag.

Form tag has three attributes as follows

Action Attribute

This attribute specifies where to send the form-data when a form is submitted or what action needs to be performed when  form  is  submitted.

e.g., If we want a program “\cgi\bin\comments.exe” to be executed, when a form is submitted , then we write

action = “/cgi/bin/comments. exe”

Method Attribute

This attribute defines how the data will be submitted to the server to go to the next page. Two methods are there, get and post. In get method, the data of the form is appended in the URL of next page.

e.g.,                                        <form method = “get/post” action = “a. exe” >

Encrypt Attribute

This is used to inform the server the way to handle the encryption process. encrypt = “application/x-www. form-urlencoded”

Elements of a Form

The elements of a form can be of three types

  • Input box
  • Selection list box or combo box
  • Text area

 

Input Box and Type Values

Example

 

Check Box Radio Button Text Field Password Hidden Field

Button

Submit Button Reset Button

  • input type = “check box” name = CB>
  • input type = “radio” name = RB>
  • input type = “text” name = TF>
  • input type = “password” name = Pwd>
  • input type = “Hidden” name = HF>
  • input type = “Button” name = Btn>
  • input type = “Submit” name = SB>
  • input type = “Reset” name = RB>

 

Selection Box (Combo Box) The <select • tag is used to cloak) a soloct tist (drop down list).

The option> tag inside the select element define the available options in the list.

<select>

<option val ue = “vol vo” > vol vo < /opti on> <option val ue = “scoda” > scoda < /option>

<opti on val ue = “Mercedes” > mercedes < /opti otO </select>

Text Area Multiline area in which user can type the text as input. It has three attributes as number of rows, number of columns in text area and the name of the variable.

e.g.,

<html>

<body>

<center> Enter your text

<text area Name = “Remarks” rows = 5 column = 50>

</text area>

</center>

</body>
</html>

Frames

Frames allow us to divide a browser window into several independent Parts. It is a way of displaying two or more pages at once.

Frames could be applied for the following on the web page as given below

  • To display the log or a stationary information in one fixed portion of the
  • For the table of contents in a page, where people can just click and move around the website without having to more constantly to the contents

 

 

 

 

 

 

 

 

Example for Cols

< frameset cols = 200, 400> size is in pixel

cols specify the number of vertical windows or frames and values in them specify the width of the frame in frameset. We can provide values either in pixel or in percentage. For percentage we need to mention values with % sign, For pixel, we should not give any sign with the value as in above

example.

 

 

 

Example for Rows

Row specifies number of horizontal windows or frames and values in rows specify the height of the frame < frameset rows = 100, 40%, *›

Frame window will have three frames, where the height of the first frame is of 100 pixels, the second is 40% of the main window and the height of the 3rd one will occupy the rest of the window space.

 

 

e.g.,

<frameset rows = “50%”, “50%”>

<frame set col s = “50%”, “50%”>

<frame src = A. html>

<frame src = B. html> </frameset>

<frame cols = “50%”, “50%”>

<frame src = C. htmi >

<f rame src = D.htmt>

</ frameset>

 

 

 

 

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95

Leave a Reply

Your email address will not be published. Required fields are marked *