WP Manual Complete
WP Manual Complete
COMPUTER ENGINEERING
DEPARTMENT
C. K. PITHAWALA COLLEGE OF ENGINEERING &
TECHNOLOGY, SURAT
GUJARAT TECHNOLOGICAL
UNIVERSITY
Practical Assignment
Name of
Student
Enrollment No.
Date
:
Plac
e:
Page 1 of 30
Web Programming (3160713) 220090107061
INDE
X
2.2 Validation
Page 2 of 30
Web Programming (3160713) 220090107061
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" maximum-scale=1.0 user-
scalable=no>
<title>CKPCET College Campus | Landing Page</title>
<link rel="icon" type="image/X-icon" href="/WP/landing page/ckpcet logo.png">
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="https://kit.fontawesome.com/a62fc32c54.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="hed">
<div class="apply">
<a href="https://ckpcet.ac.in/" target="_blank">Apply Now</a>
</div>
</div>
<div class="footer-bottom">
<div class="foot">
<p><i class="fa-solid fa-phone"></i><a href="tel:+917862824298">+91 78628 24298
(BE/ME)</a></p>
<p><i class="fa-solid fa-phone"></i><a href="tel:+919023437774">+91 90234 37774
(BBA/BCA/BCOM)</a></p>
Page 3 of 30
Web Programming (3160713) 220090107061
Page 4 of 30
Web Programming (3160713) 220090107061
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Vel earum odit quia
deserunt voluptas adipisci voluptatem amet repellendus saepe sint.</p>
<button>Read More</button>
</div>
<div class="box3">
<i class="fa-sharp fa-solid fa-book"></i>
<h3>Library & Book Stores</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Culpa omnis corporis dolore,
esse unde nisi explicabo id tempore perferendis animi!</p>
<button>Read More</button>
</div>
</div>
</div>
</body>
</html>
style.css
*{
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: rgb(254, 254, 254);
}
.hed{
position: fixed;
background-color: rgb(11, 40, 94);
top: 0;
width:
100%;
height: 5vh;
display: flex;
justify-content: end;
padding-right:
150px;
}
.apply{ displa
y: flex;
background:
transparent; justify-
content: center; width:
10%;
height: 100%;
align-items:
center;
background-color: #ffff00;
}
.apply:hover{
background-color: #ffff00e9;
color: #000000;
font-weight:
bold; font-size:
18px;
}
.footer-bottom{
display: flex;
position:
absolute; width:
100%; height:
5vh;
background-color: rgb(11, 40, 94);
bottom: 0;
justify-content:
center; align-items:
center;
}
.footer-bottom
.foot{ display:
flex; width: 90%;
height: 90%;
background-color: #ffff00;
justify-content: space-between;
align-items: center;
padding: 0px 10px 0px
10px; background:
transparent;
}
.foot p{
background-color:
black; background:
transparent;
Page 5 of 30
Web Programming (3160713) 220090107061
padding: 4px;
margin-right:
5px;
background-color: #fcfc01;
}
.foot i:hover{
padding:
3px;
}
.foot a{
text-decoration:
none; color:
#ffffffaa;
font-weight: bold;
background:
transparent;
}
.foot a:hover{
color:
#ffffff;
}
.hed1{
position: fixed;
display: flex;
width: 100%;
height: 6vh;
margin-top:
5vh;
background: transparent;
background-color:
#ffffff; color: #000000;
justify-content: space-
between; align-items: center;
}
.hed1 p{
background:
transparent; font-size:
30px;
user-select: none;
}
.logo{
height: 40px;
margin: 5px;
user-select:
none;
border: 1px solid rgb(0, 0,
0); border-radius: 100px;
margin-left: 100px;
}
.logo-
font-size: 35px;
margin-left:
4px;
text-shadow: -1px 1px 0
#ffffff, 1px 1px 0 #efe146,
1px -1px 0 #42afac,
-1px -1px 0 #f5ef44;
}
.navigation{
background:
transparent; font-
weight: bold;
gap: 20px;
}
.search{
background:
transparent; display:
flex;
position: relative;
align-items: center;
justify-content:
right; margin-right:
50px; height: 30px;
width: 20%;
border-radius: 20px;
}
.search i{
color:
black;
border: 2px solid black;
background-color: rgb(189, 198, 195);
border-radius:
100%; padding:
5px; margin-inline:
10px;
}
.search i:hover,.search
input:hover{ font-size: 20px;
}
.search input{
display: flex;
height: 30px;
width:
100%; color:
black;
background: transparent;
background-color: rgb(189, 198,
195); border: none;
border-radius:
20px; padding-left:
20px;
Page 6 of 30
Web Programming (3160713) 220090107061
Page 7 of 30
Web Programming (3160713) 220090107061
.better button:hover{
border-radius:
10px;
background-color:
#fcfc01bb; border: 2px solid
black;
font-weight: bold;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}
.sub-div{
width: 70%
;
height:
40%; top:
55vh; left:
50%;
transform: translateX(-
50%); position: absolute;
background-color: black;
background: transparent;
display: flex;
justify-content:
center; align-items:
center;
}
.sub-div .box-
container{ display:
flex;
width: 90%; height:
90%; top:10vh;
background-color: cadetblue;
background: transparent;
justify-content: center;
align-items: center;
}
.box1, .box2, .box3
{ display: flex;
flex-direction: column;
justify-content: space-
between; align-items: center;
height: 90%; width: 90%;
}
.box1:hover, .box2:hover, .box3:hover
{ background-color: #fefefcec;
border: 0.5px solid black;
box-shadow: rgba(0, 0, 0, 0.17) 0px -23px 25px
0px inset, rgba(0, 0, 0, 0.15) 0px -36px 30px 0px
inset, rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset,
rgba(0, 0, 0, 0.06) 0px 2px 1px, rgba(0, 0, 0,
0.09) 0px 4px 2px, rgba(0, 0, 0, 0.09) 0px 8px
4px, rgba(0, 0, 0, 0.09) 0px 16px 8px, rgba(0, 0,
0, 0.09) 0px 32px 16px;
}
.box1 i,.box2 i,.box3
i{ color: rgb(0, 0, 0);
font-size: 25px;
margin-top: 30px;
background: transparent;
}
.box1 h3,.box2 h3,.box3
h3{ background:
transparent;
}
.box1 p,.box2 p,.box3
p{ text-align:center;
font-size: 15px;
background:
transparent; margin-
inline: 20px;
}
.box1 button,.box2 button,.box3
button{ margin-bottom: 20px;
padding: 5px 10px 5px 10px;
background-color: #fcfc01b0;
border: none;
border-radius: 4px;
}
.sub-div button:hover{
background-color:
#fcfc01; border: 1px solid
black; font-weight: bold;
}
Page 8 of 30
Web Programming (3160713) 220090107061
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PremierFlix | Subscription Landing Page</title>
<link rel="icon" type="image/X-icon" href="/WP/landing page Subscription/logo.png">
<link rel="stylesheet" href="/WP/landing page Subscription/style.css">
<script src="https://kit.fontawesome.com/a62fc32c54.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="hed">
<div class="main_hed">
<div class="logo_and_nav">
<div class="image">
<img src="/WP/landing page Subscription/logo.png" alt="PremierFlix Logo" id="image1">
<h1 id="logo_name"><span style="color: white;">PREMIER</span><SPAN style=" color:
red;">FLIX</SPAN></h1>
</div>
<div class="nav">
<a href="#" id="nav1"><i class="fa-solid fa-house"></i>HOME</a>
<a href="#" id="nav2"><i class="fa-solid fa-video"></i>PREMERS</a>
<a href="#" id="nav3"><i class="fa-solid fa-film"></i>MOVIES</a>
<a href="#" id="nav4"><i class="fa-brands fa-youtube"></i>SERIES</a>
<a href="#" id="nav5"><i class="fa-regular fa-money-bill-1"></i>PRICING</a>
<a href="#" id="nav6"><i class="fa-solid fa-ticket"></i>TICKETS</a>
Page 9 of 30
Web Programming (3160713) 220090107061
</div>
</div>
<div class="sign_button">
<h4 id="but1">Sign in</h4>
<button id="but2">Get started free</button>
</div>
</div>
</div>
<div class="container">
<div class="main-container">
<div class="plan-heading">
<div class="plan-heading1">
<h1>Plan for every stage of your <br>watching journey</h1>
<h6>Start watching for free and pay as you more enjoy.</h6>
</div>
<div class="plan-heading2">
<h3>Subscription Plan & Pricing</h3>
<div id="month-year">
<button id="year">Yearly</button>
<button id="month">Monthly</button>
</div>
</div>
</div>
<div class="plan-select">
<div class="plan1">
<div id="plan-type1">
<p>Silver Screen</p>
</div>
<div id="plan-price1">
<div id="plan1">
<p><sup>$</sup>100</p>
</div>
<div id="content1">
<p><span>✓</span> 4K video Resolution</p>
<p><span>✓</span> Ad Free Viewing</p>
<p><span>✓</span> Unlimited Device Access</p>
<p><span>✓</span> Offline downloads</p>
</div>
<div id="button1">
<button><i class="fa-solid fa-cart-shopping" style="margin-right:
10px;"></i>PURCHASE</button>
</div>
</div>
</div>
<div class="plan2">
<div id="plan-type2">
<p>Platinum Premier</p>
</div>
<div id="plan-price2">
<div id="plan2">
<p><sup>$</sup>10</p>
</div>
Page 10 of 30
Web Programming (3160713) 220090107061
<div id="content2">
<p><span>✓</span> Full HD Video resolution</p>
<p><span>✓</span> Ad Free Viewing</p>
<p><span>✓</span> Upto 3 Device Access</p>
<p><span>✓</span> Offline downloads</p>
</div>
<div id="button2">
<button><i class="fa-solid fa-cart-shopping" style="margin-right:
10px;"></i>PURCHASE</button>
</div>
</div>
</div>
<div class="plan3">
<div id="plan-type3">
<p>Freemium</p>
</div>
<div id="plan-price3">
<div id="plan3">
<p><sup>$</sup>0</p>
</div>
<div id="content3">
<p><span>✓</span> 480p video Resolution</p>
<p><span>✓</span> Ad Supported Viewing</p>
<p><span>✓</span> Single Device Access</p>
<p><span>✓</span> Streaming Only</p>
</div>
<div id="button3">
<button><i class="fa-solid fa-cart-shopping" style="margin-right: 10px;"></i> CHOOSE
PLAN</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="foot">
<div class="main_foot">
<div class="main_foot_logo">
<h1 id="foot_logo_name"><span style="color: white;">PREMIER</span><SPAN style=" color:
red;">FLIX</SPAN></h1>
<p>A cinematic experience like no <br>other at the comfort of your home</p>
</div>
<div class="social_link">
<h4>FOLLOW US ON OUR SOCIALS</h4>
<div class="icon">
<a href="#" id="icon1"><i class="fa-brands fa-square-youtube"></i></a>
<a href="#" id="icon2"><i class="fa-brands fa-x-twitter"></i></a>
<a href="#" id="icon3"><i class="fa-brands fa-facebook"></i></a>
<a href="#" id="icon4"><i class="fa-brands fa-square-instagram"></i></a>
</div>
</div>
<div class="contact">
Page 11 of 30
Web Programming (3160713) 220090107061
<h4>CONTACT INFORMATION</h4>
<div class="contact-area">
<div id="i_tag">
<i class="fa-solid fa-location-dot"></i>
<i class="fa-solid fa-phone"></i>
<i class="fa-solid fa-envelope"></i>
</div>
<div id="a_tag">
<a href="#">Eastlands, Lane 40</a>
<a href="#">+254 798765433</a>
<a href="#">[email protected]</a>
</div>
</div>
</div>
<div class="imp_link">
<h4>IMPORTANT LINKS</h4>
<div class="link">
<a href="#" id="link1">Privacy Policy</a>
<a href="#" id="link2">Terms & Conditions</a>
<a href="#" id="link3">Help Center</a>
</div>
</div>
</div>
</div>
</body>
</html>
style.css
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.hed{
position:
sticky; height:
3em; width:
100%;
top: 0;
background-color: rgb(0, 0, 0);
}
.foot{
position: fixed;
/* height: 15vh;
*/ height: 7.4em;
width: 100%;
bottom: 0;
background-color:
black; display: flex;
align-items: center;
}
.container{
height: calc(100vh - 7.4em -
3em); width: 100%;
background-color: rgba(0, 0, 0,
0.9); display: flex;
justify-content:
center; align-items:
center;
}
.hed .main_hed
{ height:
100%;
width:
100%;
display: flex;
justify-content: space-
around; align-items: center;
}
.main_hed .logo_and_nav
Page 12 of 30
Web Programming (3160713) 220090107061
align-items: center;
}
.logo_and_nav .image
{ height: 100%;
width: 20%;
display:
flex;
justify-content:
center; align-items:
center;
}
.image
#image1{ heig
ht: 100%;
border-radius: 100%;
}
.image
#logo_name{ font-
weight: bold; font-
size: 100%;
}
.logo_and_nav .nav
{ height: 100%;
width: 80%;
display:
flex;
justify-content:
center; align-items:
center;
}
.nav
#nav1,#nav2,#nav3,#nav4,#nav5,#nav6{ te
xt-decoration: none;
margin-inline:
1%; color: white;
font-weight:
bold; font-size:
80%;
}
.nav
#nav1:hover,#nav2:hover,#nav3:hover,#nav4:ho
ver,#nav5:hover,#nav6:hover{
color: rgba(235, 50, 50,
0.877); text-decoration:
underline;
border-bottom: 2px solid rgba(235, 50, 50,
0.877);
padding-bottom: 2px;
}
#nav1 i,#nav2 i,#nav3 i,#nav4 i,#nav5 i,#nav6
i{ color: white;
margin-right:
width:
25%;
display:flex
;
justify-content:
center; align-items:
center;
}
.sign_button
#but1{ width:
20%;
text-align: center;
margin-inline:
5%; color: white;
font-size: 1.2em;
border: px solid rgb(255, 255,
255); color: white;
background-color: rgba(20, 34, 192,
0.708); border-radius: 15px;
padding: 4px 0px;
}
.sign_button
#but2{ padding:
5px; height: 75%;
width: 50%;
font-size: 100%;
border-radius:
20px;
}
#but1:hover{
color:
black;
background-color: white;
}
#but2:hover{
background-color: rgba(20, 34, 192,
0.708); color: white;
}
/* footer */
.foot .main_foot
{ height:
100%;
width:
100%;
display: flex;
justify-content:
center; align-items:
center;
}
.main_foot_logo
{ height: 90%;
Page 13 of 30
Web Programming (3160713) 220090107061
width: 90%;
/* font-size: 1.5em; */
}
.main_foot_logo
p{ height: 50%;
width: 90%;
text-align: left;
color: white;
font-size:
70%;
}
.social_link{
height:
90%;
width: 25%;
}
.social_link h4{
text-align:
center; margin:
1%;
font-size: 60%;
color: rgb(8, 0, 255);
}
.social_link .icon
{ height: 40%;
width:
100%;
display: flex;
justify-content:
center; align-items:
center;
}
.icon #icon1,.icon #icon2,.icon #icon3,.icon
#icon4{ colo
r: white;
margin-inline: 2%;
font-size: 100%;
}
.contact{ hei
ght: 90%;
width: 25%;
}
.contact h4{
text-align:
center; margin:
1%;
font-size: 60%;
color: rgb(8, 0, 255);
}
.contact .contact-
area{ height: 80%;
width:
width:70% ;
display:
flex;
flex-direction:
column; padding-top:
1%;
}
.contact-area
#a_tag{ height:
100%;
width:
100%;
display: flex;
flex-direction:
column; padding-top:
1%;
}
#i_tag i{
text-align: end;
margin: 1%
5%;
padding: 1% 5%;
font-size: 80%;
color:rgb(8, 0, 255) ;
}
#a_tag a{
text-align: start;
margin: 1%
0%;
font-size: 80%;
text-decoration:
none; color: white;
}
.imp_link{ h
eight: 90%;
width: 25%;
}
.imp_link h4{
text-align:
start;
margin: 1% 0% 0% 30%;
font-size: 60%;
color: rgb(8, 0, 255);
}
.imp_link .link
{ height:
80%;
width:
100%;
display: flex;
flex-direction: column;
}
Page 14 of 30
Web Programming (3160713) 220090107061
height: 20%;
width: 90%;
display:
flex;
justify-content:
center; align-items:
center;
}
#button1 button, #button2 button
,#button3 button{
height: 60%;
width: 70%;
font-size:
15px;
border-radius:
10px; color: white;
background-color: rgba(235, 50, 50,
0.877); border: none;
}
.plan-
heading1{ hei
ght: 80%;
width: 60%;
font-size:
140%; padding:
8px; display:
flex;
flex-direction:
column; justify-
content: center;
}
.plan-heading1 h1{
line-height: 40px;
color: white;
}
width: 40%;
text-align:
center; padding-
top: 1%;
font-size:
150%; display:
flex;
flex-direction:
column; align-items:
center; color: white;
font-weight: bold;
}
.plan-heading2 #month-
year{ height: 25%;
width: 25%;
background-color: rgb(54, 82,
157); border-radius: 5px;
margin: 4%;
padding:
5px; display:
flex;
}
#month-year:hover,
#year:hover{ border: 1px solid
white;
}
#year,#month{
height:
100%;
width: calc(100%/2);
border: 1px solid
black; color: white;
background-color: rgba(235, 50, 50,
0.877); border-radius: 5px;
}
Page 16 of 30
Web Programming (3160713) 220090107061
Page 17 of 30
Web Programming (3160713) 220090107061
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Single Page - Neaty</title>
<link rel="stylesheet" href="/WP/single_page_website/style.css">
</head>
<body>
<div class="main">
<div class="left">
<div class="logo">
<img src="/WP/single_page_website/neaty_logo.png" alt="This is logo of Neaty">
</div>
<div class="nav">
<ul>
<li style="color: yellow;">Welcome</li>
<li>About Us</li>
<li>Gallery One</li>
<li>Second Gallery</li>
<li>Third Gallery</li>
<li>Contact Us</li>
</ul>
</div>
</div>
<div class="right">
<div class="main-img">
<img src="/WP/single_page_website/main.png" alt="This is main image">
</div>
<div class="content">
<div class="welcome">
<h1>Welcome to Neaty Design</h1>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Magnam quo vero, neque facilis
cupiditate repellendus tenetur quae architecto minima ab nam libero! Vitae recusandae, possimus at,
maiores exercitationem et sequi tempora cumque impedit veniam nobis, culpa repudiandae architecto
laudantium provident dicta dolores quas. Voluptates, quo minus. Quas natus fuga dignissimos
laboriosam aspernatur consequuntur! Accusantium excepturi sint reprehenderit delectus voluptatibus
dolores!</p>
</div>
<div class="aboutus">
<div class="abimg">
<img src="/WP/single_page_website/about.webp" alt="This is image about us">
</div>
<div class="abcontent">
<h2>About the team</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto unde placeat, similique
maiores ullam earum vero, quaerat, a eos ea repudiandae molestiae recusandae eligendi distinctio?
Page 18 of 30
Web Programming (3160713) 220090107061
Blanditiis consequuntur architecto dolorem. Magnam, vero deserunt laboriosam ea quas veritatis, sed
porro mollitia, cum animi dolor voluptas minima cumque eius autem vel. Voluptatibus, cum?</p>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Minus tempora cumque
architecto ipsum natus nam perferendis quo, in velit ducimus! Nihil consequatur cumque molestias
amet dignissimos illo, corrupti obcaecati autem aliquam? Odit tempora dignissimos accusamus ipsam
alias, illo eligendi, tenetur beatae facilis voluptate sint officia fuga iusto nisi ullam dolores!</p>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Corporis at incidunt similique
perferendis quam deleniti, velit nemo odio ab fugiat omnis eaque ut, et voluptatem!</p>
<button>Read More</button>
</div>
</div>
<div class="gallery-one">
<h2>Gallery One</h2>
<div class="img-one">
<img src="/WP/single_page_website/1 (1).png" alt="This is picture">
<img src="/WP/single_page_website/1 (2).png" alt="This is picture">
<img src="/WP/single_page_website/1 (1).png" alt="This is picture">
<img src="/WP/single_page_website/1 (3).png" alt="This is picture">
<img src="/WP/single_page_website/1 (4).png" alt="This is picture">
<img src="/WP/single_page_website/1 (2).png" alt="This is picture">
<img src="/WP/single_page_website/1 (4).png" alt="This is picture">
</div>
</div>
<div class="gallery-two">
<h2>Gallery Two</h2>
<div class="img-two">
<img src="/WP/single_page_website/1 (6).png" alt="This is picture">
<img src="/WP/single_page_website/1 (8).png" alt="This is picture">
<img src="/WP/single_page_website/1 (7).png" alt="This is picture">
<img src="/WP/single_page_website/1 (8).png" alt="This is picture">
<img src="/WP/single_page_website/1 (6).png" alt="This is picture">
</div>
</div>
<div class="gallery-third">
<h2>Gallery Third</h2>
<div class="img-third">
<img src="/WP/single_page_website/1 (5).png" alt="This is picture">
<img src="/WP/single_page_website/1 (10).png" alt="This is picture">
<img src="/WP/single_page_website/1 (11).png" alt="This is picture">
<img src="/WP/single_page_website/1 (5).png" alt="This is picture">
<img src="/WP/single_page_website/1 (9).png" alt="This is picture">
<img src="/WP/single_page_website/1 (11).png" alt="This is picture">
<img src="/WP/single_page_website/1 (10).png" alt="This is picture">
</div>
</div>
<div class="contactus">
<h2>Contact Us</h2>
<div class="contact">
<div class="form">
<input type="text" placeholder="Name">
Page 19 of 30
Web Programming (3160713) 220090107061
style.css
*{
margin: 0;
padding: 0;
}
.main{ displa
y: flex;
}
.left{
width: 25rem;
background-color: rgb(32, 150,
190); border: 1px solid black;
border-right: none;
}
.left .logo {
margin-top:
50%;
padding: 5%
0; height:
auto; display:
flex;
justify-content: center;
}
.left .logo img{
border-radius:
100px; height: 90px;
width: 200px;
height: auto;
display:
flex;
justify-content: center;
}
.nav ul li{
list-style-type:
none; margin: 5px
80px; padding: 5px;
font-weight: bold;
text-transform:
capitalize; font-size:
1.3em;
}
.right{ height
: auto;
width: 75rem;
background-color: rgb(255, 255,
255); border: 1px solid black;
}
.main-img{
width: calc(100%);
}
.main-img img{
width:
calc(100%);
Page 20 of 30
Web Programming (3160713) 220090107061
Page 21 of 30
Web Programming (3160713) 220090107061
promt.js
// Function to check if a number is prime
function isPrime(num) {
// Check if num is less than 2
if (num < 2) {
return false;
}
// Check if num is divisible by any number less than itself
for (let i = 2; i <= Math.sqrt(num); i++) {
if (num % i === 0) {
return false;
}
}
return true;
}
// Prompt the user to enter a number
let userInput = prompt("Enter a number prime or not:");
// Convert userInput to a number
let number = parseInt(userInput);
// Check if the number is
prime if (isPrime(number)) {
alert(number + " is a prime number.");
} else {
alert(number + " is not a prime number.");
}
OUTPUT:
Page 22 of 30
Web Programming (3160713) 220090107061
Email Yes A valid email address and domain of the same should
match with the domain selected above.
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Validation</title>
<script src="/WP/validate.js"></script>
</head>
<body>
<h2>Form Validation</h2>
<form onsubmit="return validateForm()">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br>
<label for="address">Address:</label>
<input type="text" id="address" name="address"><br>
<label for="phone">Phone:</label>
<input type="text" id="phone" name="phone"><br>
<label for="domain">Domain:</label>
<input type="text" id="domain" name="domain" required><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br>
<label for="password">Password:</label>
Page 23 of 30
Web Programming (3160713) 210090107023
validate.js
function validateForm() {
// Get form inputs
var name = document.getElementById("name").value;
var address =
document.getElementById("address").value; var phone =
document.getElementById("phone").value; var domain =
document.getElementById("domain").value; var email =
document.getElementById("email").value;
var password = document.getElementById("password").value;
var confirmPassword = document.getElementById("confirmPassword").value;
// Name validation
var namePattern = /^[a-zA-Z]+\s[a-zA-Z]+\s[a-zA-Z]+$/;
if (name.trim() === "" || !name.match(namePattern)) {
alert("Please enter a valid name (Firstname Middlename
Lastname)."); return false;
}
// Address validation
var addressPattern = /^[a-zA-Z0-9, ]*$/;
if (address.trim() !== "" && !address.match(addressPattern)) {
alert("Address can contain alphabets, digits, and commas only.");
return false;
}
// Phone validation
var phonePattern = /^(?:\+?91)?(?:\d{10}|\d{11})$/;
if (phone.trim() !== "" && !phone.match(phonePattern)) {
alert("Please enter a valid Indian mobile number or landline number.");
return false;
}
// Domain validation
var domainPattern = /^ckpcet\.(ac\.in|com)$/;
if (!domain.match(domainPattern)) {
alert("Please enter a valid domain name (e.g., ckpcet.ac.in or
ckpcet.com)."); return false;
}
// Email validation
var emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!email.match(emailPattern) || !email.endsWith(domain)) {
alert("Please enter a valid email address with the selected domain.");
return false;
Page 24 of 30
Web Programming (3160713) 220090107061
}
// Password validation
var passwordPattern = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@#$])[A-Za-z\d@#$]
{8,}$/; if (!password.match(passwordPattern)) {
alert("Password must contain minimum 8 characters, at least 1 uppercase letter, 1 digit, and
1 special symbol (@, #, $, etc.).");
return false;
}
// Confirm Password validation
if (password !== confirmPassword)
{ alert("Passwords do not
match."); return false;
}
return true;
}
OUTPUT:
Page 25 of 30
Web Programming (3160713) 220090107061
regexr.html
<!-- This bellow website use for learn Regular expression - Pattern matching -->
<!-- https://regexr.com/ -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Regular Expression</title>
</head>
<body>
<label>Enter Mail Id:</label>
<input type="email" id="mail">
<button type="submit" onclick="validate()">Validate Email</button>
<script src="/WP/regexr.js"></script>
</body>
</html>
regexr.js
function validateEmail(email, domains) {
// Regular expression pattern for validating email addresses
var emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
// Check if the email matches the pattern
if (!email.match(emailPattern)) {
return false; // Email format is incorrect
}
// Extract domain from the email address
var domain = email.split('@')[1];
// Check if the domain is in the specified list of domains
return domains.includes(domain);
}
function validate(){
var email = document.getElementById("mail").value;
var domains = ["gmail.com", "googlemail.com", "google.com"];
Page 26 of 30
Web Programming (3160713) 220090107061
if (validateEmail(email, domains))
{ alert("Email is valid.");
}
else {
alert("Email is not valid.");
}
}
OUTPUT:
Invalid Email & Domain:
Page 27 of 30
Web Programming (3160713) 220090107061
Css_manipulation.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Change Background Color</title>
<style>
.content {
background-color: white;padding: 20px; margin: 20px; width: 30%; border: 1px solid black;
}
</style>
</head>
<body>
<div class="content">
<p>This is the content area.</p>
<button onclick="changeBackgroundColor()">Get More</button>
</div>
<script>
function changeBackgroundColor() {
// Get the content area element
var content = document.querySelector('.content');
OUTPUT:
(Before clicking Get More button) (After clicking Get More button)
Page 28 of 30
Web Programming (3160713) 220090107061
E-R Diagram:
Page 29 of 30
Web Programming (3160713) 220090107061
Page 30 of 30