Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
11 views

HTML Forms

Uploaded by

hasansabri203
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

HTML Forms

Uploaded by

hasansabri203
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

NAVA NALANDA

GROUP OF SCHOOLS

NAVA NALANDA COMPUTER DEPARTMENT


FORM
An HTML form is used to collect user input. The user input is most often sent to a server for
processing.
The Form Element in HTML is used to create an HTML form for user input.
The Element is a container for different types of input elements, such as: text fields, checkboxes,
radio buttons, submit buttons, etc.

THE INPUT ELEMENT:

The HTML <INPUT> element is the most used form element.


An <INPUT> element can be displayed in many ways, depending on the TYPE attribute.

Type Description

Displays a single-line text input field


Displays a radio button (for selecting one of many choices)

Displays a checkbox (for selecting zero or more of many choices)

Submit
Displays a submit button (for submitting the form)
TEXT BOX CONTROL
THE <INPUT TYPE= “TEXT”> defines a single-line input field for text input.

<html>
<head><title> Text Control </title></head>
<FORM>
<H1> NAVA NALANDA COMPUTER DEPARTMENT </H1>
<hr>
<font color="red" size=5>
<BR>
NAME OF THE STUDENT :
<input type="text" name="S-NAME SIZE=50">
<br>
CLASS-SECTION :
<input type="text" name="CLASS-SEC" SIZE=3">
</FORM>
</html>

FILE → SAVE AS → DESKTOP → FORM1.HTML → SAVE

TEXTBOX CONTROL [OUTPUT : FORM1.HTML]

NAVA NALANDA COMPUTER DEPARTMENT

NAME OF THE STUDENT :

CLASS-SECTION :

Notice that each input field must have a name attribute to be submitted.
If the name attribute is omitted, the value of the input field will not be sent at all.
CHECKBOX CONTROL

Checkboxes let a user select ZERO or MORE options of a limited number of choices.

<html>
<head><title> CHECK BOX </title></head>
<FORM>
<h1 align="center">
NAVA NALANDA COMPUTER DEPARTMENT </h1>
<hr>
<h2 align="center">
<font color="BLUE" size=3>
<u>SELECT YOUR FAVOURITE CHAPTERS </u></font></h2>
<input type="Checkbox" name="HTML" value="on"> HTML
<BR>
<input type="Checkbox" name="NETWORKING" value="on"> NETWORKING
<BR>
<input type="Checkbox" name="MS-ACCESS" value="on"> MS-ACCESS
<BR>
<input type="Checkbox" name="MS-EXCEL" value="on"> MS-EXCEL
<br>
<input type="submit" value="Select Subject">
</FORM>
</html>
FILE → SAVE AS → DESKTOP → FORM2.HTML → SAVE

CHECKBOX CONTROL [OUTPUT : FORM2.HTML]

NAVA NALANDA COMPUTER DEPARTMENT

SELECT YOUR FAVOURITE CHAPTERS :

 HTML
 NETWORKING
 MS-ACCESS
 MS-EXCEL

SUBMIT
RADIO BUTTON CONTROL
<html>
<head><title> RADIO BUTTONS </title></head>
<body>
<h1 align="center">NAVA NALANDA COMPUTER DEPARTMENT </h1>
<hr>
<FORM>
<h2 align="center">
<font color="BLUE" size=3>
<U>
SELECT YOUR FAVOURITE STREAM :
</u></font></h2>
<BR>
<input type="radio" name="STREAM" value="SCI"> Science
<input type="radio" name="STREAM" value="COM"> Commerce
<input type="radio" name="STREAM" value="HUM"> Humanities
<br>
<br>
<hr>
<input type="submit" value="Submit the form">
<input type="reset" value="Cancel">
</form>
</body>
</html>
FILE → SAVE AS → DESKTOP → FORM3.HTML → SAVE
RADIO BUTTON CONTROL [OUTPUT : FORM3.HTML]

NAVA NALANDA COMPUTER DEPARTMENT

SELECT YOUR FAVOURITE STREAM :

 Science  Commerce  Humanities

Submit the form Cancel


FORM

…………………………….

You might also like