Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions Form-Validation/codding form styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
*{
margin:0;
padding:0;
box-sizing:border-box;
}


:root{
--myfont : 'Mulish', sans-serif;
--my-btn-font : 'Montserrat' , sans-serif;
--lg-lightcolor: linear-gradient(to left , rgba(116,235,213,0.6), rgba(159, 172, 230,0.5));
--lg-color: linear-gradient(to left, #74ebdf , #9face6);

}

body{

background-image: url("formimage.jpg");
background-color: #4da6ff;
background-size:100%;
background-repeat: no-repeat;
font-family: var(--myfont);
display:flex;
align-items: center;
justify-content: center;
min-height:100vh;
width:100vw;
}

.container{
background-color:#fff;
border-radius : 10px;
-webkit-border-radius:10px;
box-shadow : 0 2.8px 2.2px rgba(0,0,0,0.340),0 6.7px 5.3px rgba(0,0,0,0.480);
overflow:hidden;
width: calc(100vw - 65vw);
max-width : 100%;
}

.header{
background:var(--lg-color);
padding:30px 0;
}

.header h2{
color:#222;
font-family: var(--my-btn-font);
font-size:24px;
text-transform: uppercase;
text-align:center;
}


.form{
padding:30px 40px;
}

.form-control{
margin-bottom: 15px;
position:relative;
}

.box{
position : relative;
}

.box input{
width:16px;height:16px;
margin-top:5px;
}

.box label{
font-size: 15px;
}

.form-control label{
display: inline-block;
margin-bottom:5px;
font-size:15px;
}

.form-control input{
width: 100%;
border:2px solid #f0f0f0;
border-radius:5px;
display:block;
font-family:var(--myfont);
font-size:14px;
padding:9px;
}

.form-control input:focus{
outline: 0;
border-color : #777;
}

.form-control.success input{
border-color: #2ecc71;
}

.form-control.error input{
border-color: #e74c3c;
}

.form-control i{
position: absolute;
right:12px;
top:38px;
visibility: hidden;
}


.form-control.success i.fa-check-circle{
color: #2ecc71;
visibility:visible;
}

.form-control.error i.fa-exclamation-circle{
color:#e74c3c;
visibility:visible;
}

.form-control small{
color:#e74c3c;
position: absolute;
left:0;
visibility: hidden;
}

.form-control.error small{
visibility:visible;
}

.box small{
color:#e74c3c;
position: absolute;
left:0;
top:100%;
visibility: visible;
}


.form .btn{
background: var(--lg-color);
border-radius: 6px;
border:none;
outline:none;
color:#fff;
display: block;
font-family : var(--my-btn-font);
font-size : 16px;
padding:15px 0;
margin-top: 20px;
width: 100%;
font-weight : bold;
text-transform: uppercase;
transition: all 1s ease;
}


.form .btn:hover{
background: linear-gradient(to right, #74ebd5, #9face6);
}

@media (min-width:501px) and (max-width:998px){
.container{
width: calc(100vw - 40vw);
max-width:100%;
}
}

@media (max-width:500px){
.container{
width: calc(100vw - 20vw);
max-width:100%;
}
}

70 changes: 70 additions & 0 deletions Form-Validation/codding form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title> Form Validation </title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" rel="stylesheet">
<link href="codding form styles.css" type= "text/css" rel="stylesheet">
</head>
<body>

<div class="container">
<div class="header">
<h2>CODING BUDDIES REGISTRATION FORM</h2>
</div>
<form class="form" id="form">
<div class="form-control">
<label>Username</label>
<input type="text" name="username" id="username" placeholder="Enter Your Username" autocomplete="off" onkeyup="validateusername(this.value)">
<i class="fas fa-check-circle"></i>
<i class="fas fa-exclamation-circle"></i>
<small> Error Msg </small>
</div>
<div class="form-control">
<label>Email</label>
<input type="email" name="email" id="email" placeholder="Enter Your Email" autocomplete="off" onkeyup="validateemail(this.value)">
<i class="fas fa-check-circle"></i>
<i class="fas fa-exclamation-circle"></i>
<small> Error Msg </small>
</div>
<div class="form-control">
<label>School / College / Organization name</label>
<input type="text" name="institute" id="institute" placeholder="Enter name accordingly" autocomplete="off"
onkeyup="validatecollegename(this.value)">
<i class="fas fa-check-circle"></i>
<i class="fas fa-exclamation-circle"></i>
<small> Error Msg </small>
</div>
<div class="form-control">
<label>Phone Number</label>
<input type="number" name="phone" id="phone" placeholder="Enter Your Phone Number" autocomplete="off" onkeyup="validatephone(this.value)">
<i class="fas fa-check-circle"></i>
<i class="fas fa-exclamation-circle"></i>
<small> Error Msg </small>
</div>
<div class="form-control">
<label>Password</label>
<input type="password" name="password" id="password" placeholder="Enter Your Password" autocomplete="off" onkeyup="validatepassword(this.value)">
<i class="fas fa-check-circle"></i>
<i class="fas fa-exclamation-circle"></i>
<small> Error Msg </small>
</div>
<div class="form-control">
<label>Retype Password</label>
<input type="password" name="cnfpassword" id="cnfpassword" placeholder="Enter Your Password again" autocomplete="off"
onkeyup="validatecnfpass(this.value)">
<i class="fas fa-check-circle"></i>
<i class="fas fa-exclamation-circle"></i>
<small> Error Msg </small>
</div>
<div class="box">
<input type="checkbox" name="terms" id="terms" onchange="validatecheckbox(this)">
<label for="terms"> I have read all the Terms and Conditions</label>
<small> Agree to Terms & Conditions checkbox </small>
</div>

<input type="submit" class="btn" value="Submit" name="submit" >

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script src="codeform.js"></script>
</body>
</html>
Loading