Webdesign
Webdesign
ASSIGNMENT FILE
ON
WEB DESIGN LAB
(507P)
Submitted by – Submitted to -
Name – mukesh kumar singh Class Coordinator :
Course – bca 3rd year Mr. Abhishek Verma
Roll no – 2212774040045
INDEX
Teacher’s sign :
4. Design HTML form for keeping student record and validate it
using Java script.
<!DOCTYPE html>
<html>
<head>
<title>Student Record Form</title>
<script>
function validateForm() {
var name = document.forms["studentForm"]["name"].value;
var rollno = document.forms["studentForm"]["rollno"].value;
var email = document.forms["studentForm"]["email"].value;
if (name == "" || rollno == "" || email == "") {
alert("All fields must be filled out");
return false;
}
return true;
}
</script>
<style>
body{
background-color: rgb(117, 115, 115);
color: bisque;
align-items: center;
display: flex;
flex-direction: column;
}
</style>
</head>
<body>
<h1>Student Record Form</h1>
<form name="studentForm" onsubmit="return validateForm()"
method="post" action="/submit_record">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name"><br><br>
<label for="rollno">Roll Number:</label><br>
<input type="text" id="rollno" name="rollno"><br><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Output :
3. Create a web page to get the coordinates from an image using
java script.
<!DOCTYPE html>
<html>
<head>
<title>Get Image Coordinates</title>
<script>
function getCoords(event) {
var x = event.clientX;
var y = event.clientY;
alert("X: " + x + ", Y: " + y);
}
</script>
</head>
<body>
<h1>Click on the Image to Get Coordinates</h1>
<img src="https://www.w3schools.com/w3images/mac.jpg"
onclick="getCoords(event)" alt="Clickable Image">
</body>
</html>
Output :
1. HTML program for form creation.
<!DOCTYPE html>
<html>
<head>
<title>Form Creation</title>
<style>
body{
background-color: rgb(117, 115, 115);
color: bisque;
align-items: center;
display: flex;
flex-direction: column;
}
input{
border-radius: 10px;
}
button{
background-color: rgb(90, 88, 88);
color: wheat;
border-radius: 10px;
transform: translateX(64px);
}
</style>
</head>
<body>
<h2>Registration Form</h2>
<form action="/submit_form" method="post">
<br>
<input type="text" id="name" name="name" placeholder="Enter
Name"><br>
<br>
<input type="email" id="email" name="email" placeholder="Enter
Email"><br>
<br>
<input type="password" id="password" name="password"
placeholder="Enter password"><br> <br>
<button>Submit</button>
</form>
</body>
</html>
Output :
5. HTML program for home page creation using frames.
<!DOCTYPE html>
<html>
<head>
<title>Home Page with Frames</title>
</head>
<frameset rows="50%,50%">
<frame src="https://www.pexels.com/search/landscape/ "
name="headerFrame">
<frameset cols="50%,50%">
<frame src="https://c8.alamy.com/comp/HN577H/industrial-plant-factory-
sketch-vintage-building-vector-illustration-HN577H.jpg" name="menuFrame">
<frame src="https://cdn.vectorstock.com/i/1000v/71/86/old-factory-
engraving-style-drawing-plant-vector-42667186.jpg" name="contentFrame">
</frameset>
</frameset>
</html>
Output :
2. Create a web page to embed an image map in a web page using
HTML.
<html>
<head>
<title>
Image Mapping
</title>
</head>
<body>
<h1> Laptop </h1><br>
<img src="https://encrypted-
tbn0.gstatic.com/images?q=tbn:ANd9GcQAXgRavueujW4ZPy098yEM4eZnaNm
7p18IeQ&s" alt="laptop" height="400px" width=
"700px"><br>
<h1><q> A small computer that is easy to carry and that
can use batteries for power. </q></h1> I
</body>
</html>
• Image map : The <map> tag is used to define an image map. An image
map is an image with clickable areas. The required name attribute of the
<map> element is associated with the <img>'s usemap attribute and
creates a relationship between the image and the map.
• Note : We have to click anywhere at the laptop shows in the above given
image.