Unit - 5-1
Unit - 5-1
cols Pixels It specifies the number and size of column spaces in the frameset. (Not
% Supported in HTML5)
*
rows Pixels It specifies the number and size of the rows spaces in the frameset. (Not
% Supported in HTML5)
*
<html>
<head>
<title>Frame tag</title>
</head>
<frameset cols="50%,50%">
<frame src="https://www.mcc.edu.in">
<frame src="https://www.google.com">
</frameset>
</html>
Nested Frames
<HTML>
<HEAD>
<TITLE>A simple frameset document</TITLE>
</HEAD>
<FRAMESET cols="20%, 80%">
<FRAMESET rows="100, 200">
<FRAME src="contents_of_frame1.html">
<FRAME src="contents_of_frame2.gif">
</FRAMESET>
<FRAME src="contents_of_frame3.html">
</FRAMESET>
</HTML>
<html>
<head> Nested Frames – Another Example
<title>Nested Framesets in HTML</title>
</head>
<!-- Frameset tag starts from here -->
<!-- We divide the whole website into three rows -->
<!-- "*" divides equally based on the left space -->
<frameset rows="50%,*,*">
<!-- Here we are defining the columns
in the first row -->
<!-- It is set to 100% which means that
it will cover first row by 100% -->
<frameset cols="100%">
<!-- Defining the frame which is
to be inserted -->
<frame name="frame1" src="frame1.html">
</frameset>
<!-- Here we are defining the columns
in the second row -->
<frameset cols="*, *, *">
<frame name="frame2" src="frame2.html">
<frame name="frame3" src="frame3.html">
<frame name="frame4" src="frame4.html">
</frameset>
<!-- Now the final third row which will
cover the rest space -->
<frame name="frame5" src="frame5.html">
</frameset>
<!-- frameset tag ends here -->
</html>
Nested Frames – frame 1.html
<html>
<head>
<title>frame1</title>
</head>
<body bgcolor="aqua">
<center>
<img src="C:\Users\Persis Glory\Desktop\liontiger.gif" alt=“Lion Tiger"
width="400" height="350"><br>
frame1
</center>
</body>
</html>
HTML action attribute
The action attribute of <form> element defines the process to be performed on form when form is submitted, or it is a URI
to process the form information.
The action attribute value defines the web page where information proceed. It can be .php, .jsp, .asp, etc. or any URL
where you want to process your form.
<html>
<body>
<h2>Demo of action attribute of form element</h2>
<form action="action.html" method="post">
<label>User Name:</label><br>
<input type="text"
name="name"><br><br>
<label>User Password</label><br>
<input type="password"
name="pass"><br><br>
<input type="submit">
</form>
<p><b>It will redirect to a new page "action.html" when you
click on submit button</b></p>
</body>
</html>
HTML method attribute
The method attribute defines the HTTP method which browser used to submit the form. The possible values of method
attribute can be:
•post: We can use the post value of method attribute when we want to process the sensitive data as it does not display
the submitted data in URL.
•get: The get value of method attribute is default value while submitting the form. But this is not secure as it displays
data in URL after submitting the form.
Example:
<form action="action.html" method="post">
Example:
<form action="action.html" method="get">
The HTML enctype attribute defines the encoding type of form-content while submitting the form to the server.
<form>
<label for="name">Enter name</label><br>
<input type="text" id="name" name="name"><br>
<label for="pass">Enter Password</label><br>
<input type="Password" id="pass" name="pass"><br>
<input type="submit" value="submit">
</form>
<Html> Text Box – input type = text
<Head>
<Title> The type="text" attribute of input tag creates textfield control
Create the Text Box also known as single line textfield control.
</Title>
</Head>
<Body>
Hello User! <br>
<form>
Student Name:
<input type="text" name="Name" size="20">
<br> <br>
Course:
<input type="text" name="Course" size="15">
</form>
</Body>
</Html>
<Html> Drop Down List - <label> <option value = “ “ >
<Head>
<Title>
Make a Drop Down Menu using Html Form
</Title>
</Head>
<Body>
This page helps you to understand how to make a dropdown menu in Html document.
And, this section helps you to understand how to make a drop down menu using Html form.
<form>
<label> Select Cars </label>
<select>
<option value = "BMW"> BMW
</option>
<option value = "Mercedes"> Mercedes
</option>
<option value = "Audi"> Audi
</option>
<option value = "Skoda"> Skoda
</option>
</select>
</form>
</Body>
</Html>
create a multi-line text input in HTML
<body>
<form action = "/cgi-bin/hello_get.cgi" method = "get">
What improvements you want in College?
<br>
<textarea rows = "5" cols = "60" name = "description">
Enter details here...
</textarea><br>
<input type = "submit" value = "submit" />
</form>
</body>
</html>
<html>
<head> Checkbox in HTML
<title>HTML check box </title>
</head>
<body> The checkbox control is used to check multiple options from
<form> given checkboxes.
<h1> Example </h1>
<h2> HTML Checkbox Button Example </h2>
Select the hobbies you have:
<br>
<input type="checkbox"
name="reading"
value="yes"> <label for = "Reading"> Reading
</label> <br>
<input type="checkbox"
name="dancing"
value="yes"> <label for = "Dancing"> Dancing
</label> <br>
<input type="checkbox"
name = "singing"
value ="yes"> <label for = "Singing"> Singing
</label> <br>
</form>
</body>
</html>
Radio Button in HTML
<html>
The radio button is used to select one option from multiple options. It is
<head>
used for selection of gender, quiz questions etc.
</head>
If you use one name for all the radio buttons, only one radio button can
<title> Example of Radio Button</title>
be selected at a time.
<body>
Using radio buttons for multiple options, you can only choose a single
<form>
option at a time.
<label>
Gender:
</label> <br>
<input type="radio" id="gender" name="gender"
value="male"/> Male
<br>
<input type="radio" id="gender" name="gender"
value="female"/> Female <br/>
</form>
</body>
</html>
HTML <fieldset> tag
HTML <fieldset> tag is used to group the logically related fields/labels contained within an HTML form.
The use of this tag is optional while creating an HTML form but using <filedset>, it is easy to understand the purpose of
grouped elements of form.
The <fieldset> element in HTML is used to group the related information of a form. This element is used with <legend>
element which provide caption for the grouped elements.
<html>
<head> A Registration form in HTML – using <fieldset>
<title>Form in HTML</title>
</head>
<body>
<h2>Registration form</h2>
<form>
<fieldset>
<legend>User personal information</legend>
<label>Enter your full name</label><br>
<input type="text" name="name"><br>
<label>Enter your email</label><br>
<input type="email" name="email"><br>
<label>Enter your password</label><br>
<input type="password" name="pass"><br>
<label>confirm your password</label><br>
<input type="password" name="pass"><br>
<br><label>Enter your gender</label><br>
<input type="radio" id="gender" name="gender" value="male"/>Male <br>
<input type="radio" id="gender" name="gender" value="female"/>Female <br/>
<input type="radio" id="gender" name="gender" value="others"/>others <br/>
<br>Enter your Address:<br>
<textarea></textarea><br>
<input type="submit" value="sign-up">
</fieldset>
</form>
</body>
</html>