Presentation is loading. Please wait.

Presentation is loading. Please wait.

Forms Sangeetha Parthasarathy 02/05/2001. Introduction to Forms A form makes it possible to transform your web pages from text to graphics to interactive.

Similar presentations


Presentation on theme: "Forms Sangeetha Parthasarathy 02/05/2001. Introduction to Forms A form makes it possible to transform your web pages from text to graphics to interactive."— Presentation transcript:

1 Forms Sangeetha Parthasarathy 02/05/2001

2 Introduction to Forms A form makes it possible to transform your web pages from text to graphics to interactive survey’s that provide different options based on reader’s input. Basic Form Elements: Text Fields, Radio Buttons, Check Boxes. Other Form Elements: Text area, Menu of options and hidden fields.

3 Anatomy of a form Creating a form usually involves two independent steps: Creating layout for the form and Writing a program to process information on a form. A simple example: Enter your name:

4 Submit Button Submit buttons tell the browsers to send the form data to server. You should include at least one submit on every form. 1.To create a submit button, in the type attribute in, put submit. For ex: 2.To change the label of the text of button, 3.You can have multiple submit button by having the name attribute in. For ex:

5 Text Field Fields Text Fields enable the reader to type text in a single-line field. For multiple-line field, we need 1.To create a text-entry field, you can type “text” in type attribute in or leave the type specification altogether, as the default type for tag is text. 2.You can include name attribute in as this gives name to the field. 3.We can include the attribute size and maxlength. Size – specifies the length of text-entry in characters. Default is 20..

6 Maxlength – Specifies the limit of number of characters. If maxlength is less than size, browsers will draw a text field of size as maxlength. A Simple Example Enter your name: Enter your age:

7 Radio Buttons Radio Buttons indicates a list of items of which only one can be chosen.. If one button is selected, all the button in the same list are deselected. 1.To create the radio button, type radio in the type attribute. Animal 2.By default, all the radio buttons are off(deselected). You can determine the default radio button using the CHECKED attribute. Animal

8 Checkboxes Checkboxes makes it possible to choice multiple items. Each checkbox can off or on. The default is off. 1.The checkbox can be created by typing checkbox in type attribute. 2.The CHECKED attribute can be default the checkbox.. For ex: Red Green

9 A Sample Program Female Male C++ Java Visual Basic

10 Selections Selections enables the user to select one or more items from a menu or scrolling list. They are similar to radio buttons or checkboxes in a different visual format.. 1.The selections are indicated by tag and individual options within the selection with tag. 2.The tag has a name attribute to hold the value. 3.You can set the default item to be selected by using the selected attribute part of the tag.

11 By default only item can be selected. By using the multiple attribute part of tag. The optional attribute usually displays the scrolling list with the number of elements in the size attribute. For ex: Select a hair color: Black Blonde Brown Red Blue

12 Textarea Textareas are input fields in which the reader can type. Unlike text-input fields, textareas can contain many lines of text for forms that require extensive input. 1.A textarea can be created using. 2.A name can be given for the textarea using the name attribute. 3.The height of textarea can be specified using row attribute. 4.The width of textarea can be specified using cols attribute.

13 A textarea has a closing tag. If you need a default message, include it between. It allows to control text wrapping in browser. In Netscape, the textarea does not wrap, it simply scrolls in right. Use wrap attribute to change the wrapping behaviour. –Wrap=OFF – The default, text on one line. –Wrap=SOFT – Text wraps automatically in browser window and sends to server in one line. –Wrap=HARD – Text wraps automatically in browser but send to the server with newline.

14 An Example of form A Form Example Enter details of a student Enter student id: Sex:: Female Male Hobbies: Singing Dancing Reading (cont’d)

15 Please specify your age group: less than 17 18-20 21-25 26-30 31- 35 36-40 more than 40. Write in detail about your career goals: Career Goals


Download ppt "Forms Sangeetha Parthasarathy 02/05/2001. Introduction to Forms A form makes it possible to transform your web pages from text to graphics to interactive."

Similar presentations


Ads by Google