View
693
Download
0
Category
Preview:
Citation preview
Name of presentation
Creating Forms
Tutorial VI
HTML files or part of files made to be filled in by viewer / reader for the purpose of submitting information to the forms originator.
HTML Forms
CGI ( Common Gateway Interface) Script
is any program or set of commands running on the Web server that receives data from the Web page and then acts on that data to perform a certain task.
Elements of Forms:
Input boxes for text and numerical entries
Radio buttons also called option buttons, to select a single option from a predefined list
Selection lists for long lists of options, usually in a drop-down list box
Check boxes to specify an item as either being present or absent
Text areas for extended entries that might include several lines of text
Submit and Reset buttons to either submit the form to the CGI script or to reset the form to its original state
CGI script can be written in variety of computer languages such as the following:
AppleScript
C / C++
Perl
The UNIX shell
TCL
Visual Basic
JavaScript
Syntax of Form:
Form elements and layout tags
Working with Input Boxes
Input Box is a single-line box into which the user can enter text or numbers.
Syntax:
where option is the type of input field, and Text is the name assigned to the input field.
Example
Setting a Default Value for an Input Box
where value is the default text or number that will appear in the field.
Example
Creating a Password field
Password Field is identical to an input box except that the characters typed by the user are displayed as bullets or asterisks.
CREATING A SELECTION LIST
To create a selection list, use the following set of HTML tags:
Option 1 Option 2 Option 3 . .
Where the NAME property is the field name of the selection list, and each tag represents an entry in the list.
Scanmaster Scanmaster II LaserPrint 1000 LaserPrint 5000 Print/Scan 150 Print/Scan 250
Example
To allow the user to select multiple items in the selection list, use the following tag:
To display several items in the selection list, or to change the selection list style from a drop-down list box to a fully displayed list box, use the following tag:
where value is the number of items displayed in the list box.
Working with Radio Buttons
Syntax:
Where text is the name assigned to the field containing the radio button, and value is the value of the radio button.
Example
HomeBusinessGovernmentEducational InstitutionOther
To create a radio button, use the following HTML tag:
Where the NAME property specifies the field containing the radio button, and the VALUE property specifies the value sent to the CGI script.
To make a particular radio button the default option, use the following tag:
WORKING WITH CHECK BOXES
To create a check box, use the following tag:
where the NAME property specifies the field containing the check box, and the VALUE property specifies the value sent to the CGI script if the check box is selected.
To make a check box selected by default, use the following tag:
Example
Windows 95/98/NTWindows 3.X/DOSMacintoshUNIXOther
CREATING A TEXT AREA
To create a text area for extended text entry, use the following tag:
Default Text
Where the Default Text is the text that initially appears in the text area (this is optional)
To control how text is wrapped in a text area, use the following tag:
Where option is OFF, SOFT (or VIRTUAL) ,or HARD (or PHYSICAL). OFF turns off text wrapping. SOFT (VIRTUAL) turns text wrapping on, but does not send text wrapping information to the Web server. HARD (PHYSICAL) turns text wrapping on and also sends this information to the Web server.
Example
Enter comments here
Fin
Recommended