0% found this document useful (0 votes)
463 views

HTML Form

HTML forms allow users to enter information through various form elements like text fields, checkboxes, radio buttons, and dropdown menus. Key elements in forms include the <form> tag, which defines a form region, and the <input> tag, which specifies different input types like text, radio, checkbox, submit buttons, and more. Forms also use attributes like "action" to specify where submitted data gets sent.

Uploaded by

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

HTML Form

HTML forms allow users to enter information through various form elements like text fields, checkboxes, radio buttons, and dropdown menus. Key elements in forms include the <form> tag, which defines a form region, and the <input> tag, which specifies different input types like text, radio, checkbox, submit buttons, and more. Forms also use attributes like "action" to specify where submitted data gets sent.

Uploaded by

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

HTML Form & input

HTML forms are used to Select Different Kinds of user inputs.


Form- A Form is an area that can contain form elements. Form Elements are
element’s that allow the user to enter information (Line text Field’s, Text area
field’s, Drop-down menu’s, Radio Button’s, Checkbox’s etc.) in a form.
A Form is defined with <form> tag.
Syntax-
<Form>
<Input>
<Input>
</form>
Input- The most use Form tag is the <input>tag. The type of input is specified
with the type attribute.

TEXT FIELD- Text field are Used When you want the user to type Latter, Num-
ber etc. in a form.

EXAMPLE-
<Html>
<Head>
<Title> text field</title>
</head>
<Body>
<Form>
First Name:
<input type=”text” name=”First Name”><br>
Last Name:
<input type=”text” name=”Last Name”><br>
Father’s Name:
<input type=”text” name=”Father’s Name”><br>
Mother’s Name:
<input type=”text” name=”Mother’s Name”>
</form>
</body>
</html>
RADIO BUTTONS-
Radio Buttons are used when you want to the user to select one of
limited Number of choice.

EXAMPLE-
<Html>
<Head>
<Title> Radio Button’s</title>
</head>
<Body>
<Form>
<input type=”Radio” name=”Sex” value=”Male”>
Male <br>
<input type=”Radio” name=”Sex” value=”Female”>
Female
</form>
</body>
</html>
CHECKBOX-
Checkbox are used when you want to select one or more Options of a
limited number of choices.

EXAMPLE-
<Html>
<Head>
<Title> Checkbox</title>
</head>
<Body>
<Form>
I have a Bike.
<input type=”Checkbox” name=”Vehicle” value=”Bike”><br>
I have a Car.
<input type=”Checkbox” name=”Vehicle” value=”Car”><br>
I have an airplane.
<input type=”Checkbox” name=”Vehicle” value=”Airplane”>
<Br>
I have a Hotel
<input type=”Checkbox” name=”Vehicle” value=”Hotel”>
</form>
</body>
</html>
FORM, ACTION ATTRIBUTE & THE SUBMIT BUTTON-
When the user clicks on the submit button the content of the form is
sent to another file. The form’s action attribute define the name of
the file to send the content to IIS Manager. The file defined in the ac-
tion attribute usually does something with the received input

EXAMPLE-
<Html>
<Head>
<Title> Submit Button’s</title>
</head>
<Body>
<form name=”input” action=”html_From_action.asp” method=”put”>
User Name:
<input type=”text” name=”user”>
<input type=”submit” value=”submit”>
</form>
</body>
</html>
CREATE A BUTTON-
This Example demonstrates how to create a button. On the button
you can define your own text.
EXAMPLE-
<Html>
<Head>
<Title> Button</title>
</head>
<Body>
<Form>
<input type=”button” value=”Hello India”><br>
<input type=”button” value=”Apply”><br>
<input type=”button” value=”Submit”>
<input type=”button” value=”Cancel”>
<input type=”button” value=”OK”>
<input type=”button” value=”Gmail”>
<input type=”button” value=”Facebook”>
<input type=”button” value=”Google”>
<input type=”button” value=”More”>
</form>
</body>
</html>

FIELD SET ARROUND THE DATA


This Example Demonstrate how to draw a border with a caption
around your data.

EXAMPLE-
<Html>
<Head>
<Title> Fieldset</title>
</head>
<Body>
<Fieldset>
<Legend>Health Information</legend>
<Form>
Height:
<input type=”text” size=”3”><br>
Weight:
< input type=”text” size=”3”><br>
B.P.
<input type=”text” size=”3”><br>
Sugar:
<input type=”text” size=”3”>
</form>
</Fieldset>
</body>
</html>
SIMPLE DROP-DOWN MENU’S
This Example Demonstrate How to create a simple Drop-Down Menu
on an HTML Page. A Drop-Down box(menu) is a selectable list.
EXAMPLE-
<Html>
<Head>
<Title> Drop Down Menu</title>
</head>
<Body>
<form>
<Select name=”Disttrict”>
<option value=”ballia”>Ballia</option>
<option value=”Basti”>Basti</option>
<option value=”Faizabad”>Faizabad</option>
<option value=” Varanasi”>Varanasi</option>
<option value=” Kanpur”>Kanpur</option>
<option value=” Sant Kabeer Nagar”>Sant Kabeer Na-
gar</option>

You might also like