|
|
|
|
Forms can gave three kinds of text boxes; single-line text boxes, password boxes and
multi-line text areas. Single-line text boxes are added to the form using the <input> tag with
TYPE attribute set to "text". The NAME attributes sets its name, the size attributes set the width of the box, the
MAXLENGTH attributes sets the maximum number of characters that can be entered into it and th3e value
attribute sets its default value. The input tag does not require any closing tag.
Checkboxes re added to the form using the <INPUT> tag with the TYPE attribute set to "checkbox ". The NAME attribute sets its name and the VALUE attributes sets the value of the checkbox. multiple checkboxes can be grouped together together by assigning them the same name. The values to the checkboxes that are selected are sent as a comma-separated list when the form is submitted to set checkbox enables by default, add the checked attribute .The input tag does not required any closing tag.
Radio buttons are added to the form using the <input> tag with the TYPE attribute set to "radio". The name attribute sets its name and the VALUE attribute set the value of the radio button that selected is sent when the form is submitted. To set a radio button enabled by default, add the CHECKED attribute .The input tag does not required any closing tag.
Lists can be of two kind; drop-down list or simple list boxes. Lists are created using the <SELECT> tag. The NAME attribute sets the name of the list. The SIZE attribute determines the number of rows visible to the user at once .If SIZE is set to 1 or not specified, the list is displayed a a drop down list, otherwise it is displayed as a list box . To allow selection of multiple items in the list, add the MULTIPLE attribute. The tag is closed using </SELECT>. List items are added to the list using the <OPTION> tag. The VALUE attribute sets the value of the list item that is sent within the form is submitted. To have a list item selected by default, add the SELECTED attribute.
Hidden form fields are added to the form using the <INPUT> tag with the TYPE attribute set to "hidden". The NAME attribute sets its name and the VALUE attribute sets its value. The input tag dose not required any closing tag. Hidden fields are not visible to the user and can be used to pass values across pages that you don't want the user to see. For example, this hidden fields are not visible to the user and can be used to pass values across pages that you don't want the user to see For example, this hidden field holds information of where the user arrived at the page from, so that the user can be sent back to that page after the form has been submitted.
Button can be of three kinds; simple buttons, submit buttons and reset buttons. The latter two are just specialized forms of the simple button. Button are added to the form using the <input> tag with the TYPE attribute set to "button" for a simple button, "submit" for a submit button and "reset" for a reset button. The Name attribute sets its name and VALUE attribute sets the text that is displayed on the button. The submit button submits the form and the reset button resets the form to its default values. When using a simple button, you can call a java Script or VBScript function using its OnClick event.
You can use an image instead of a submit button to submit the form. Images are added to the form using the <INPUT> tag with the TYPE attribute set to "image" . The NAME attribute sets its name . The SRC tag specifies the location of the images. You can use other attributes from the image tag with this when the form is submitted, two entry variables, X and Y are sent, which hold the co-ordinates of the image.
Frames allow you to display multiple web pages within the same window. When working with frames. a special kind of page is used. This page holds the layout of the frames and calls other web pages within each frame. This page does not have any <BODY> tag, as this page itself cannot display any content to the user, Instead the <BODY> tag is replaced by the <FRAMESET> tag , you specify the location of the frames. The ROWS attribute of the <FRAMESET> tag specifies how many rows a frame should span across. Similarly, the COLS attribute sets the number of columns it spans across. The height or width of the frame can be specified as fixed pixels, relative to each other or as a percentage of the window size. The <FRAME> tag is used to define the properties of each frame. This tag does not require any closing tag. The tags are included between the opening and closing
<FRAMESET> tags, once for each frame. The NAME attribute sets the name of the frame and the
SRC attribute provides the location from where it should load the page it will hold. The
NO RESIZE attribute prevents the frame from being resized by the user. The
SCROLLING attribute sets whether the user can scroll across the frame or not, if the page it holds is larger than the page it
golds is larger than the frame. The MARGIN WIDTH and MARGIN HEIGHT attributes sets the width and
height, respectively, of margins within the frame . The BASE TARGET attribute
specifies the default location where links from this frame should open. This is similar to the TARGET attribute of the anchor tag.
We have now learnt the basics of HTML. With all the WYSIWYG software that create
Web pages in a flash, it is not necessary to know HTML. However, knowing it provides a better understanding of the
development environment. We are now ready |