HTML Multi step form doesn't work on Mobile - javascript

I have a multistep form but the multi-steps doesn't work on mobile it shows all the steps in one go even the success message.
Please help me if possible
The HTML-CSS and javascript code I got it from here:
https://codepen.io/TyStelmach/pen/yNxMeJ
---
The HTML Code
```
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src=
"https://code.jquery.com/jquery-3.2.1.min.js">
</script>
<script src=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
type="text/javascript">
</script>
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.js"></script>
</head>
<div class="info">
<h1>Please fill in the form </h1>
<span>
Made with
<i class="fa fa-beer"></i>
by
AAA Web Agency
<div class="spoilers">
Need “Permission to Contact” language that is TCPA compliant </div>
</span>
</div>
<!-- Modal -info -->
<div class="container">
<div id="modal-3" class="modal" data-modal-effect="slide-top">
<div class="modal-content">
<h2 class="fs-title">Score Index</h2>
<h3 class="fs-subtitle">Getting the most out of your data</h3>
<p>Your data has been successfully submited</p>
<input type="button" name="next" class="next action-button modal-close" value="Got it!">
</div>
</div>
</div>
<form name='form1' class="steps" accept-charset="UTF-8" enctype="multipart/form-data" novalidate="">
<ul id="progressbar">
<li class="active">Step 1</li>
<li>Step2</li>
</ul>
<!-- USER INFORMATION FIELD SET -->
<fieldset>
<h2 class="fs-title">Basic Information</h2>
<h3 class="fs-subtitle">We just need some basic information to begin</h3>
<!-- Begin What's Your User ID Field -->
<div class="hs_firstname field hs-form-field">
<label for="firstname-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Your 8 digits User ID *</label>
<input id="id" name="user_id" required="required" type="number" onkeyup="GetDetail(this.value)" value="" placeholder="" data-rule-required="true" data-msg-required="Please insert your 8 digits User ID" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End What's Your User ID Field -->
<!-- Begin What's Your First Name Field -->
<div class="row">
<div class="col-md-6">
<label for="firstname-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">What's your First Name? *</label>
<input id="first_name" name="first_name" required="required" type="text" value="" placeholder="" data-rule-required="true" data-msg-required="Please include your first name" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End What's Your First Name Field -->
<!-- Begin What's Your Last Name Field -->
<div class="col-md-6">
<label for="firstname-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">What's your First Name? *</label>
<input id="last_name" name="last_name" required="required" type="text" value="" placeholder="" data-rule-required="true" data-msg-required="Please include your last name" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
</div>
<!-- End What's Your Last Name Field -->
<!-- Begin Address Field -->
<div class="hs_firstname field hs-form-field">
<label for="firstname-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Your Address *</label>
<input id="address" name="address" required="required" type="text" value="" placeholder="" data-rule-required="true" data-msg-required="Please include your address" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End Adress Field -->
<!-- Begin City Field -->
<div class="row">
<div class="col-md-4">
<label for="firstname-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">City *</label>
<input id="city" name="city" required="required" type="text" value="" placeholder="" data-rule-required="true" data-msg-required="Please include your City" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End City Field -->
<!-- Begin State Field -->
<div class="col-md-4">
<label for="firstname-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">State *</label>
<input id="state" name="state" required="required" type="text" value="" placeholder="" data-rule-required="true" data-msg-required="Please include your State" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End State Field -->
<!-- Begin Zip Field -->
<div class="col-md-4">
<label for="firstname-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Zip Code *</label>
<input id="zip" name="zip" required="required" type="text" value="" placeholder="" data-rule-required="true" data-msg-required="Please include your Zip Code" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
</div>
<!-- End Zip Field -->
<!-- Begin What's Your Email Field -->
<div class="hs_email field hs-form-field">
<label for="email-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Your E-mail Address? *</label>
<input id="email-99a6d115-5e68-4355-a7d0-529207feb0b3_2983" name="email" required="required" type="email" value="" placeholder="" data-rule-required="true" data-msg-required="Please enter a valid email address." >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End What's Your Email Field -->
<!-- Begin Total Number of Constituents in Your Database Field -->
<div class="row">
<div class="col-md-4">
<label for="edit-submitted-constituent-base-total-constituents total_number_of_constituents_in_your_database-99a6d115-5e68-4355-a7d0-529207feb0b3_6344">Cell Phone No. *</label>
<input id="cell" class="form-text hs-input" name="cell" required="required" size="60" maxlength="128" type="phone" value="" placeholder="" data-rule-required="true" data-msg-required="Please enter a valid Cell Phone Number" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End Cell Phone Field -->
<!-- Begin Total Number of Constituents in Your Database Field -->
<div class="col-md-4">
<label for="edit-submitted-constituent-base-total-constituents total_number_of_constituents_in_your_database-99a6d115-5e68-4355-a7d0-529207feb0b3_6344">Office Phone No. </label>
<input id="office_phone" class="form-text hs-input" name="office_phone" required="required" size="60" maxlength="128" type="phone" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a Office Phone Number" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End Cell Phone Field -->
<!-- Begin Office Phone Field -->
<div class="col-md-4">
<label for="edit-submitted-constituent-base-total-constituents total_number_of_constituents_in_your_database-99a6d115-5e68-4355-a7d0-529207feb0b3_6344">Home Phone No.</label>
<input id="home_phone" class="form-text hs-input" name="home_phone" required="required" size="60" maxlength="128" type="phone" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a valid number" >
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
</div>
<!-- End Office Phone Field -->
<input type="button" data-page="1" name="next" class="next action-button" value="Next" />
</fieldset>
<!-- RETENTION FIELD SET -->
<fieldset>
<h2 class="fs-title">Retention of your donors</h2>
<h3 class="fs-subtitle">How long can you keep your donors and their donations?</h3>
<!-- Begin Monthly Rent Field -->
<div class="form-item webform-component webform-component-textfield hs_number_of_donors_in_year_1 field hs-form-field" id="webform-component-retention--amount-1">
<label for=" edit-submitted-retention-amount-1 number_of_donors_in_year_1-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Monthly Rent</label>
<input id="monthly_rent" class="form-text hs-input" name="monthly_rent" required="required" size="60" maxlength="128" type="text" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a valid Monthly Rent">
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End Monthly Rent Field-->
<!-- Begin Length of time at residence? Field -->
<div class="row">
<div class="col-md-6" id="webform-component-retention--amount-1">
<label for=" edit-submitted-retention-amount-1 number_of_donors_in_year_1-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Length of time at residence? __ yrs.</label>
<input id="residence_yrs" class="form-text hs-input" name="residence_yrs" required="required" size="60" maxlength="128" type="text" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a valid Monthly Rent">
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End Length of time Field-->
<!-- Begin Length of time at residence? Field -->
<div class="col-md-6" id="webform-component-retention--amount-1">
<label for=" edit-submitted-retention-amount-1 number_of_donors_in_year_1-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Length of time at residence?___ mos.</label>
<input id="residence_mos" class="form-text hs-input" name="residence_mos" required="required" size="60" maxlength="128" type="text" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a valid Monthly Rent">
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
</div>
<!-- End Length of time mons Field-->
<!-- Begin Age Field -->
<div class="row">
<div class="col-md-6" id="webform-component-retention--amount-1">
<label for=" edit-submitted-retention-amount-1 number_of_donors_in_year_1-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Age</label>
<input id="age" class="form-text hs-input" name="age" required="required" size="60" maxlength="128" type="text" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a valid Age">
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End Age Field-->
<!-- Begin Gender Field -->
<div class="col-md-6" id="webform-component-retention--amount-1">
<label for=" edit-submitted-retention-amount-1 number_of_donors_in_year_1-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Gender</label>
<input id="gender" class="form-text hs-input" name="gender" required="required" size="60" maxlength="128" type="text" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a valid Monthly Rent">
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
</div>
<!-- End Gender Field-->
<!-- Begin Length of time at residence? Field -->
<div class="row">
<div class="col-md-6" id="webform-component-retention--amount-1">
<label for=" edit-submitted-retention-amount-1 number_of_donors_in_year_1-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Spouse’s Name</label>
<input id="spouse_name" class="form-text hs-input" name="spouse_name" required="required" size="60" maxlength="128" type="text" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a valid Spouse’s Name">
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End Spouse’s Name Field-->
<!-- Begin Spouse’s Age Field -->
<div class="col-md-6" id="webform-component-retention--amount-1">
<label for=" edit-submitted-retention-amount-1 number_of_donors_in_year_1-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Spouse’s Age</label>
<input id="spouse_age" class="form-text hs-input" name="spouse_age" required="required" size="60" maxlength="128" type="text" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a valid Spouse’s Age">
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
</div>
<!-- End Spouse’s Age Field-->
<!-- Begin Have you contributed to a 401(k)/403(b)/IRA retirement program in the past year? select -->
<div class="form-item webform-component webform-component-textfield" id="webform-component-retention--percent-change field hs-form-field">
<label for="edit-submitted-retention-percent-change">Retention Rate</label>
<select id="select1" class="form-text hs-input" name="select1" value="" placeholder="0">
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End Have you contributed to a 401(k)/403(b)/IRA retirement program in the past year? select -->
<!-- Begin Best time/day to contact Field -->
<div class="form-item webform-component webform-component-textfield hs_number_of_donors_in_year_1 field hs-form-field" id="webform-component-retention--amount-1">
<label for=" edit-submitted-retention-amount-1 number_of_donors_in_year_1-99a6d115-5e68-4355-a7d0-529207feb0b3_2983">Best time/day to contact:</label>
<input id="best_time" class="form-text hs-input" name="best_time" required="required" size="60" maxlength="128" type="text" value="" placeholder="" data-rule-required="false" data-msg-required="Please enter a valid time">
<span class="error1" style="display: none;">
<i class="error-log fa fa-exclamation-triangle"></i>
</span>
</div>
<!-- End Best time/day to contact Field-->
<input type="button" data-page="5" name="previous" class="previous action-button" value="Previous" />
<input id="submit" class="hs-button primary large action-button next" type="submit" value="Submit">
<div class="explanation btn btn-small modal-trigger" data-modal-id="modal-3">What Is This?</div>
</fieldset>
<fieldset>
<h2 class="fs-title">It's on the way!</h2>
<h3 class="fs-subtitle">Thank you for trying out our marketing grader, please go check your email for your fundraising report card and some helpful tips to improve it!</h3>
<div class="explanation btn btn-small modal-trigger" data-modal-id="modal-3">What Is This?</div>
</fieldset>
```

You have a media query in your CSS that is responsible for exactly that behavior.
#media (max-width:675px){
/*mobile phone: uncollapse all fields: remove progress bar*/
.steps {
width: 100%;
margin: 50px auto;
position: relative;
}
#progressbar{
display:none;
}
/*move error logs */
.error1 {
position: relative;
left: 0 !important;
margin-top: 24px;
top: -11px;
}
.error1:before {
width: 0;
height: 0;
left: 14px;
top: -14px;
content: '';
position: absolute;
border-left: 6px solid transparent;
border-bottom: 8px solid #e62163;
border-right: 6px solid transparent;
}
/*show hidden fieldsets */
.steps fieldset:not(:first-of-type) {
display: block;
}
.steps fieldset{
position:relative;
width: 100%;
margin:0 auto;
margin-top: 45px;
}
.steps .next, .steps .previous{
display:none;
}
.steps .explanation{
display:none;
}
.steps .submit {
float: right;
margin: 28px auto 10px;
width: 100% !important;
}
}

And the CSS code
/*basic reset*/
* {margin: 0; padding: 0;}
html {
height: 100%;
/*Image only BG fallback*/
background: #e9e9e9;
}
body {
font-family: montserrat, arial, verdana;
width: 100%;
overflow-x: hidden;
}
/*form styles*/
.steps {
width: 100%;
margin: 50px auto;
position: relative;
}
.steps fieldset {
background: white;
border: 0 none;
border-radius: 3px;
box-shadow: 0 17px 41px -21px rgb(0, 0, 0);
padding: 20px 30px;
border-top: 9px solid #303030;
box-sizing: border-box;
width: 80%;
margin: 0 10%;
/*stacking fieldsets above each other*/
position: relative;
}
/*Hide all except first fieldset*/
.steps fieldset:not(:first-of-type) {
display: none;
}
/*inputs*/
.steps label{
color: #333333;
text-align: left !important;
font-size: 15px;
font-weight: 200;
padding-bottom: 7px;
padding-top: 12px;
display: inline-block;
}
.steps input, .steps textarea {
outline: none;
display: block;
width: 100%;
margin: 0 0 20px;
padding: 10px 15px;
border: 1px solid #d9d9d9;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
color: #837E7E;
font-family: "Roboto";
-webkti-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
font-size: 14px;
font-wieght: 400;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-transition: all 0.3s linear 0s;
-moz-transition: all 0.3s linear 0s;
-ms-transition: all 0.3s linear 0s;
-o-transition: all 0.3s linear 0s;
transition: all 0.3s linear 0s;
}
.steps input:focus, .steps textarea:focus{
color: #333333;
border: 1px solid #303030;
}
.error1{
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
-moz-box-shadow: 0 0 0 transparent;
-webkit-box-shadow: 0 0 0 transparent;
box-shadow: 0 0 0 transparent;
position: absolute;
left: 105px;
margin-top: -58px;
padding: 0 10px;
height: 39px;
display: block;
color: #ffffff;
background: #e62163;
border: 0;
font: 14px Corbel, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif;
line-height: 39px;
white-space: nowrap;
}
.error1:before{
width: 0;
height: 0;
left: -8px;
top: 14px;
content: '';
position: absolute;
border-top: 6px solid transparent;
border-right: 8px solid #e62163;
border-bottom: 6px solid transparent;
}
.error-log{
margin: 5px 5px 5px 0;
font-size: 19px;
position: relative;
bottom: -2px;
}
.question-log {
margin: 5px 1px 5px 0;
font-size: 15px;
position: relative;
bottom: -2px;
}
/*buttons*/
.steps .action-button, .action-button {
width: 100px !important;
background: #303030;
font-weight: bold;
color: white;
border: 0 none;
border-radius: 1px;
cursor: pointer;
padding: 10px 5px;
margin: 10px auto;
-webkit-transition: all 0.3s linear 0s;
-moz-transition: all 0.3s linear 0s;
-ms-transition: all 0.3s linear 0s;
-o-transition: all 0.3s linear 0s;
transition: all 0.3s linear 0s;
display: block;
}
.steps .next, .steps .submit{
float: right;
}
.steps .previous{
float:left;
}
.steps .action-button:hover, .steps .action-button:focus, .action-button:hover, .action-button:focus {
background:#444343;;
}
.steps .explanation{
display: block;
clear: both;
width: 540px;
background: #f2f2f2;
position: relative;
margin-left: -30px;
padding: 22px 0px;
margin-bottom: -10px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
top: 10px;
text-align: center;
color: #333333;
font-size: 12px;
font-weight: 200;
cursor:pointer;
}
/*headings*/
.fs-title {
text-transform: uppercase;
margin: 0 0 5px;
line-height: 1;
color: #303030;
font-size: 18px;
font-weight: 400;
text-align:center;
}
.fs-subtitle {
font-weight: normal;
font-size: 13px;
color: #837E7E;
margin-bottom: 20px;
text-align: center;
}
/*progressbar*/
#progressbar {
margin-bottom: 30px;
overflow: hidden;
/*CSS counters to number the steps*/
counter-reset: step;
width:100%;
text-align: center;
}
#progressbar li {
list-style-type: none;
color: rgb(51, 51, 51);
text-transform: uppercase;
font-size: 9px;
width: 50%;
float: left;
position: relative;
}
#progressbar li:before {
content: counter(step);
counter-increment: step;
width: 20px;
line-height: 20px;
display: block;
font-size: 10px;
color: #333;
background: white;
border-radius: 3px;
margin: 0 auto 5px auto;
}
/*progressbar connectors*/
#progressbar li:after {
content: '';
width: 100%;
height: 2px;
background: white;
position: absolute;
left: -50%;
top: 9px;
z-index: -1; /*put it behind the numbers*/
}
#progressbar li:first-child:after {
/*connector not needed before the first step*/
content: none;
}
/*marking active/completed steps green*/
/*The number of the step and the connector before it = green*/
#progressbar li.active:before, #progressbar li.active:after{
background: #303030;
color: white;
}
/* my modal */
.modal p{
font-size: 15px;
font-weight: 100;
font-family: sans-serif;
color: #3C3B3B;
line-height: 21px;
}
.modal {
position: fixed;
top: 50%;
left: 50%;
width: 50%;
max-width: 630px;
min-width: 320px;
height: auto;
z-index: 2000;
visibility: hidden;
-moz-backface-visibility: hidden;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.modal.modal-show {
visibility: visible;
}
.lt-ie9 .modal {
top: 0;
margin-left: -315px;
}
.modal-content {
background: #ffffff;
position: relative;
margin: 0 auto;
padding: 40px;
border-radius: 3px;
}
.modal-overlay {
background: #000000;
position: fixed;
visibility: hidden;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
-moz-transition-property: visibility, opacity;
-o-transition-property: visibility, opacity;
-webkit-transition-property: visibility, opacity;
transition-property: visibility, opacity;
-moz-transition-delay: 0.5s, 0.1s;
-o-transition-delay: 0.5s, 0.1s;
-webkit-transition-delay: 0.5s, 0.1s;
transition-delay: 0.5s, 0.1s;
-moz-transition-duration: 0, 0.5s;
-o-transition-duration: 0, 0.5s;
-webkit-transition-duration: 0, 0.5s;
transition-duration: 0, 0.5s;
}
.modal-show .modal-overlay {
visibility: visible;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
opacity: 0.6;
-moz-transition: opacity 0.5s;
-o-transition: opacity 0.5s;
-webkit-transition: opacity 0.5s;
transition: opacity 0.5s;
}
/*slide*/
.modal[data-modal-effect|=slide] .modal-content {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
-moz-transition: all 0.5s 0;
-o-transition: all 0.5s 0;
-webkit-transition: all 0.5s 0;
transition: all 0.5s 0;
}
.modal[data-modal-effect|=slide].modal-show .modal-content {
filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
-moz-transition: all 0.5s 0.1s;
-o-transition: all 0.5s 0.1s;
-webkit-transition: all 0.5s;
-webkit-transition-delay: 0.1s;
transition: all 0.5s 0.1s;
}
.modal[data-modal-effect=slide-top] .modal-content {
-moz-transform: translateY(-300%);
-ms-transform: translateY(-300%);
-webkit-transform: translateY(-300%);
transform: translateY(-300%);
}
.modal[data-modal-effect=slide-top].modal-show .modal-content {
-moz-transform: translateY(0);
-ms-transform: translateY(0);
-webkit-transform: translateY(0);
transform: translateY(0);
}
/* RESPONSIVE */
/* moves error logs in tablet/smaller screens */
#media (max-width:1000px){
/*brings inputs down in size */
.steps input, .steps textarea {
outline: none;
display: block;
width: 100% !important;
}
/*brings errors in */
.error1 {
left: 345px;
margin-top: -58px;
}
}
#media (max-width:675px){
/*mobile phone: uncollapse all fields: remove progress bar*/
.steps {
width: 100%;
margin: 50px auto;
position: relative;
}
#progressbar{
display:none;
}
/*move error logs */
.error1 {
position: relative;
left: 0 !important;
margin-top: 24px;
top: -11px;
}
.error1:before {
width: 0;
height: 0;
left: 14px;
top: -14px;
content: '';
position: absolute;
border-left: 6px solid transparent;
border-bottom: 8px solid #e62163;
border-right: 6px solid transparent;
}
/*show hidden fieldsets */
.steps fieldset:not(:first-of-type) {
display: block;
}
.steps fieldset{
position:relative;
width: 100%;
margin:0 auto;
margin-top: 45px;
}
.steps .next, .steps .previous{
display:none;
}
.steps .explanation{
display:none;
}
.steps .submit {
float: right;
margin: 28px auto 10px;
width: 100% !important;
}
}
/* Info */
.info {
width: 300px;
margin: 35px auto;
text-align: center;
font-family: 'roboto', sans-serif;
}
.info h1 {
margin: 0;
padding: 0;
font-size: 28px;
font-weight: 400;
color: #333333;
padding-bottom: 5px;
}
.info span {
color:#666666;
font-size: 13px;
margin-top:20px;
}
.info span a {
color: #666666;
text-decoration: none;
}
.info span .fa {
color: rgb(226, 168, 16);
font-size: 19px;
position: relative;
left: -2px;
}
.info span .spoilers {
color: #999999;
margin-top: 5px;
font-size: 10px;
}

Related

Custom checkout button in checkout.liquid

I am looking to create my own checkout button in checkout.liquid, we currently have a form checkout process but are running into and issue with getting our submit button to complete an order. We do not want to use the shopify standard checkout since this is a specialized store and everything is $0. Shipping and billing is done outside of shopify.
Here is our current layout for our form.
#textHead {
font-weight: bold;
padding-bottom: 8px;
padding-left: 5px;
padding-top: 10px;
}
#configHead{
padding-bottom: 8px;
padding-left: 5px;
font-weight: bold;
}
.textarea {
background: white;
border-radius: 8px;
padding-left: 5px;
padding-top: -10px;
border: solid 1px lightgray;
transition: all 0.3s ease 0s;
max-width: 100%;
}
.textarea:hover {
box-shadow: 2px 6px 25px 2px rgba(10,10,120,0.15);
transform: translateZ(-15px);
}
.strike {
display: block;
text-align: center;
overflow: hidden;
white-space: nowrap;
padding-bottom: 25px;
padding-top: 10px;
color: black;
}
.strike > span {
position: relative;
display: inline-block;
}
.strike > span:before,
.strike > span:after {
content: "";
position: absolute;
top: 50%;
width: 9999px;
height: 1px;
background: #0F4B97;
}
.strike > span:before {
right: 100%;
margin-right: 15px;
}
.strike > span:after {
left: 100%;
margin-left: 10px;
}
#import url('https://fonts.googleapis.com/css?family=Open+Sans:600');
.check {
bottom: 0;
display: flex;
left: calc(50% + 40px);
margin-bottom: 10px;
}
.containerOuter {
background: white;
border-radius: 8px;
}
.container {
position: relative;
margin: 20px;
overflow: visible;
width: 100px;
}
.hidden {
display: none;
}
.entry {
height: 25px;
position: absolute;
width: 160px;
}
.entry:nth-child(2) {
left: 8px;
top: 8px;
}
.entry:nth-child(4) {
left: 8px;
top: 58px;
}
.entry:nth-child(6) {
left: 8px;
top: 108px;
}
.circle {
border: 2px solid #545556;
border-radius: 50%;
cursor: pointer;
height: 20px;
position: absolute;
transition: border-color 300ms;
width: 20px;
}
.entry-label {
cursor: pointer;
margin-top: -3px;
padding-left: 40px;
user-select: none;
-moz-user-select: none;
}
.overlay {
background: #fff;
mask: url(#holes);
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAACMCAYAAAAOc+uVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAItSURBVHic7ZnNjhJBFIVPA0txr0Iyw+tIdOXWaDRufZWZeYbZuMKOUV9Gg+HHGN/BHBcNcSBT1KVOEVycb0mq635UVd9U5zQkif+Y3rkFclhQxYIqFlQZiM8vALQAPgP4AWC1+X0E4ALAFMBzAOPiCixjRfIdyX5g/h7JFyTnJYVKBGckHxQsxJBke2rBK5LF55bdal6fSnCmyO1JhlcyKrhkwbYekBySXNcUfF1L7o7k20jhhsxetxYAJk3T/Kks2EfXmkaHxkXO1MfacgCwmbPNjYsIftV1knzJDYgIfqsgkuJ7bkBE8FcFkRTr3IBzXxay9SOCjyuIFM8dEZxUECmeOyL4tIJIimluQKRRLwFcnqBRDwDMUaFRjwG8quC0zxtk5ACEL6wrksNaZiQfkvwZKRxtM08AfGDgBh2Q6wG4BfAo+sAxXB/xp+6VI3lzTMGSK3/Lgu1mt62fji1W+tH0m+R7dm9iZNVeMnjm9om0mUOs8O+zc47dz84Juh76DJG3NYEqeHLOfVnIYkEVC6pYUMWCKhZUsaCKBVUsqGJBFQuqWFDFgipO3OnEfRcn7qWCTtxTOHFP4cS9Ek7cVZy4qzhxL4ZO3AXoxF2QoxP3DifuW5y4q1hQxYIqFlSxoIoFVSyoYkEVC6pYUMWCKhZUsaCKE3c6cd/FiXupoBP3FE7cUzhxr4QTdxUn7ipO3IuhE3cBOnEX5OjEvcOJ+xYn7ioWVLGgigVV/gKEL4RSyM8Z8wAAAABJRU5ErkJggg==);
height: 80px;
pointer-events: none;
transition: background 300ms;
width: 40px;
}
.highlight {
background: #4D98EF;
border-radius: 50%;
height: 12px;
left: 14px;
pointer-events: none;
position: absolute;
top: 14px;
transition: transform 400ms cubic-bezier(0.175, 0.885, 0.32, 1.2);
transform: translateY(-50px);
width: 12px;
}
.hidden:nth-child(1):checked ~ .highlight {
transform: translateY(0);
}
.hidden:nth-child(3):checked ~ .highlight {
transform: translateY(50px);
}
.hidden:nth-child(5):checked ~ .highlight {
transform: translateY(100px);
}
.hidden:nth-child(1):checked + .entry .circle {
border-color: #4D98EF;
}
.hidden:nth-child(3):checked + .entry .circle {
border-color: #4D98EF;
}
.hidden:nth-child(5):checked + .entry .circle {
border-color: #4D98EF;
}
.check:checked ~ .containerOuter .overlay {
background: #ecf0f4;
}
</style>
<button type="submit" name="checkout" class="Cart__Checkout Button Button--primary Button--full">{{ 'cart.general.checkout' | t }}</button>
<form action="ecom#epcusa.com" method="get">
<div class="section1">
<div class="strike">
<span>LAB SERVICES</span>
</div>
<div id="textHead">Would you like to request lab services from our technology center?</div>
<div class="containerOuter">
<div class="container">
<input type="radio" class="hidden" id="input1" name="inputs">
<label class="entry" for="input1"><div class="circle"></div><div class="entry-label">No</div></label>
<input type="radio" class="hidden" id="input2" name="inputs" checked="checked">
<label class="entry" for="input2"><div class="circle"></div><div class="entry-label">Yes</div></label>
<div class="highlight"></div>
<div class="overlay"></div>
</div>
</div>
<svg width="0" height="0" viewBox="0 0 40 140">
<defs>
<mask id="holes">
<rect x="0" y="0" width="100" height="140" fill="white" />
<circle r="12" cx="20" cy="20" fill="black"/>
<circle r="12" cx="20" cy="70" fill="black"/>
<circle r="12" cx="20" cy="120" fill="black"/>
</mask>
</defs>
</svg>
<div id="box" class="config">
<p id="textHead">Lab Configuration Instructions</p>
<textarea class="textarea" name="config-instructions" cols="75" rows="5">Combine with order #[Y/N]:
Engineer Email:
Requester Email:
PM Email:
</textarea>
</div>
</div>
<div class="strike">
<span>SHIPPING</span>
</div>
<div>
<p id="textHead">Ship To MAC:Address</p>
<p>
<input type="text" class="textarea" name="shipping-search" placeholder="MAC:Address" />
</p>
<p id="textHead">Custom Address</p>
<p>
<textarea class="textarea" name="shipping-search" placeholder="Custom Adress" cols="75" rows="5"></textarea>
</p>
<p>
<p id="textHead">Shipping Instructions</p>
<!-- <p id="textSub">Provide any specific shipping requirements for your order.</p> -->
<p>
<textarea class="textarea" name="ship-instructions" cols="75" rows="4" placeholder="Example: Forklift driver, proof of insurance required, etc"></textarea>
</p>
<p>
<p id="textHead">Shipping Method</p>
</p>
<p>
<label for="ship-method" class="textarea">
<select name="shipping-method" id="ship-method" width="50px">
<option value="UPS Ground">UPS Ground</option>
<option value="Fedex Ground">Fedex Ground</option>
</select>
</label>
</p>
<p id="textHead">Requested Arrival Date</p>
<p>
<!-- <sub>Your order's request date may be based on pre-defined working days and service level agreements related to this store</sub> -->
</p>
<input type="date" class="textarea" name="arrival" />
<p>
<b>Ship To Contact</b> <!-- (Add API call for contact lookup here if can't integrate it into ship to address - Contact Email / Phone #) -->
<br /> <sub>Main point of contact for the delivery of your order.</sub>
</p>
<p>
<input type="search" class="textarea" name="shipping-contact" placeholder="Search Contact" />
</p>
</div>
<div class="strike">
<span>BILLING</span>
</div>
<label for="billing">
<b>PO Number</b>
<br />
</label>
<sub>Point of reference for your order.</sub>
<p>
<textarea class="textarea" name="po-number" cols="25" rows="1"></textarea>
</p>
<div class="strike">
<span>ORDER INFORMATION</span>
</div>
<label for="order-info">
<b>Ordered By Contact</b>
<br />
</label>
<sub>This contact will receive a confirmation email and order status notifications depending on store access and preferences.</sub>
<p>
{{ customer.name }} | {{ customer.email }}
</p>
<label for="additional-email">
<b>Additional Confirmation Email Recipients</b>
<br />
</label>
<sub>Add additional email recipients here</sub>
<p>
<textarea class="textarea" name="add-email" cols="75" rows="1" placeholder="Seperate with a "," for multiple addresses"></textarea>
</p>
<p>
<label for="reference-number">
<b>Customer Reference Number</b>
<br />
<sub>Add any additional order identiying reference numbers</sub>
</label>
</p>
<p>
<textarea class="textarea" name="reference-number" cols="25" rows="1"></textarea>
</p>
<div class="strike">
<span>COMPLETE CHECKOUT</span>
</div>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#input1").click(function(){
$("#box").slideUp("slow");
});
$("#input2").click(function(){
$("#box").slideDown("slow");
});
});
</script>
<html>
<head>
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js">
</script>
<script>
$(document).ready(function() {
$("button").click(function() {
var x = $("form").serializeArray();
$.each(x, function(i, field) {
$("#output").append(field.name + ":"
+ field.value + " ");
});
});
});
</script>
</head>
<body>
<div>
<button>Submit</button>
</div>
<div id="output"></div>
</body>
</html>```

Contact Form Animation

I have the following code:
input[type=text], [type=email], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #555;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
}
input[type=submit] {
background-color: #0563bb;
color: white;
padding: 12px 20px;
border: none;
cursor: pointer;
}
input[type=submit]:hover {
opacity: 0.9;
}
.contactform {
position: relative;
border-radius: 50px;
background-color: #f2f2f2;
padding: 5px;
z-index:2;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom:auto;
margin-top:1%;
width: 100%;
animation-name: gradient;
animation-duration: 3s;
animation-iteration-count: infinite;
}
.contactform:hover {
animation-name: gradient;
animation-duration: 15s;
animation-iteration-count: infinite;
}
.column {
float: center;
width: 50%;
margin-top: 6px;
padding: 20px;
display: block;
margin-left: auto;
margin-right: auto;
}
.row:after {
content: "";
display: table;
clear: both;
}
#media screen and (max-width: 600px) {
.column, input[type=submit] {
width: auto;
margin-top:0;
}
}
<section id="contact">
<div class="container" data-aos="fade-up">
<div class="contactform">
<div style="text-align:center">
<div class="section-title">
<h2><br/>Get In Touch</h2>
</div>
<p>Feel Free To Reach Out To Me Through This Form! </p>
</div>
<div class="row">
<div class="column">
<form name="myform" action="thankyou.html" method="POST">
<label for="firstname">First Name</label>
<input type="text" id="first name" name="firstname" placeholder="Your firstname.." required>
<label for="lastname">Last Name</label>
<input type="text" id="lastname" name="lastname" placeholder="Your last name.." required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="Your Email.." required>
<label for="subject">Subject</label>
<textarea id="subject" name="subject" placeholder="Lets Collaborate..." style="height:170px" required></textarea>
<input type="submit" value="Submit">
</form>
</div>
</div>
</div>
</div>
</section>
So what I am basically looking for is the shake effect when the user submits without entering any inputs.
Expected Output
When the user hits the submit button without entering anything, the border of the box should turn red as well as shake. I just want the boxes of the placeholders to shake and turn red, not the whole element. I tried adding keyframes to make this possible but got stuck since I was not getting the desired output, any suggestions?
In other words, I just would like the first name, last name, email, and subject borders of the boxes to turn red and shake.
Add an event listener for submit that loops through all the input and textarea fields and checks whether they are valid with checkValidity(). If they are not valid, we set their border color to red with the borderColor style attribute and set their animation with the animation style attribute.
To be able to play the same animation over and over again, we can use setTimeout to wait a specified number of milliseconds and then set the animation style attribute back to unset.
document.querySelector('form').addEventListener('submit', function(e) {
var isValid = true;
this.querySelectorAll('input, textarea').forEach(function(f) {
if (!f.checkValidity()) {
isValid = false;
f.style.borderColor = "red";
f.style.animation = "shake 0.82s forwards";
setTimeout(function(){f.style.animation="unset";},820);
}else{
f.style.borderColor = "initial";
//Sets it back to normal if the field is valid
}
})
if (!isValid) {
e.preventDefault();
}
})
input[type=text],
[type=email],
select,
textarea {
width: 100%;
padding: 12px;
border: 1px solid #555;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
}
input[type=submit] {
background-color: #0563bb;
color: white;
padding: 12px 20px;
border: none;
cursor: pointer;
}
input[type=submit]:hover {
opacity: 0.9;
}
.contactform {
position: relative;
border-radius: 50px;
background-color: #f2f2f2;
padding: 5px;
z-index: 2;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: auto;
margin-top: 1%;
width: 100%;
animation-name: gradient;
animation-duration: 3s;
animation-iteration-count: infinite;
}
.contactform:hover {
animation-name: gradient;
animation-duration: 15s;
animation-iteration-count: infinite;
}
.column {
float: center;
width: 50%;
margin-top: 6px;
padding: 20px;
display: block;
margin-left: auto;
margin-right: auto;
}
.row:after {
content: "";
display: table;
clear: both;
}
#media screen and (max-width: 600px) {
.column,
input[type=submit] {
width: auto;
margin-top: 0;
}
}
#keyframes shake {
10%,
90% {
transform: translate3d(-1px, 0, 0);
}
20%,
80% {
transform: translate3d(2px, 0, 0);
}
30%,
50%,
70% {
transform: translate3d(-4px, 0, 0);
}
40%,
60% {
transform: translate3d(4px, 0, 0);
}
}
<section id="contact">
<div class="container" data-aos="fade-up">
<div class="contactform">
<div style="text-align:center">
<div class="section-title">
<h2><br/>Get In Touch</h2>
</div>
<p>Feel Free To Reach Out To Me Through This Form! </p>
</div>
<div class="row">
<div class="column">
<form name="myform" action="thankyou.html" method="POST" novalidate>
<label for="firstname">First Name</label>
<input type="text" id="first name" name="firstname" placeholder="Your firstname.." required>
<label for="lastname">Last Name</label>
<input type="text" id="lastname" name="lastname" placeholder="Your last name.." required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="Your Email.." required>
<label for="subject">Subject</label>
<textarea id="subject" name="subject" placeholder="Lets Collaborate..." style="height:170px" required></textarea>
<input type="submit" value="Submit">
</form>
</div>
</div>
</div>
</div>
</section>

Html CSS form not showing radio button

I want to create a registration form. I put the HTML radio button code but however, it is not showing the radio buttons.
I used the "inspect element" in google chrome developer tools but couldn't resolve the problem.
I have highlighted the error-prone area. Rest areas are working fine.
Project code is given. I am new to Front End, Kindly help.
$('.form').find('input').on('keyup blur focus', function(e) {
var $this = $(this),
label = $this.prev('label');
if (e.type === 'keyup') {
if ($this.val() === '') {
label.removeClass('active highlight');
} else {
label.addClass('active highlight');
}
} else if (e.type === 'blur') {
if ($this.val() === '') {
label.removeClass('active highlight');
} else {
label.removeClass('highlight');
}
} else if (e.type === 'focus') {
if ($this.val() === '') {
label.removeClass('highlight');
} else if ($this.val() !== '') {
label.addClass('highlight');
}
}
});
$('.tab a').on('click', function(e) {
e.preventDefault();
$(this).parent().addClass('active');
$(this).parent().siblings().removeClass('active');
target = $(this).attr('href');
$('.tab-content > div').not(target).hide();
$(target).fadeIn(600);
});
* {
box-sizing: border-box;
margin: 0px;
padding: 0px;
}
body {
background: url(../background.jpg);
/*font-family: 'Titillium Web', sans-serif;*/
font-family: 'Roboto', sans-serif;
background-size: cover;
}
.user {
width: 80px;
height: 80px;
border-radius: 50%;
position: relative;
top: -10px;
left: calc(50%-50px);
right: -170px;
}
a {
text-decoration: none;
color: rgb(39, 153, 219);
transition: .5s ease;
}
a:hover {
color: #179b77;
}
.form {
padding: 40px;
max-width: 500px;
margin: 40px auto;
border-radius: 4px;
box-shadow: 0 4px 10px 4px rgba(19, 35, 47, 0.3);
transition: .5s ease;
position: relative;
}
.form:hover {
box-shadow: 0px 0px 40px 16px rgba(18, 18, 18, 1.00);
}
.tab-group {
list-style: none;
padding: 0;
margin: 0 5px 20px 0;
}
.tab-group:after {
content: "";
display: table;
clear: both;
}
.tab-group li a {
display: block;
text-decoration: none;
padding: 15px;
background: #0C0E67;
color: #fff;
font-size: 20px;
float: left;
width: 50%;
text-align: center;
cursor: pointer;
transition: .5s ease;
}
.tab-group li a:hover {
background: #0C0E67;
color: #ffffff;
}
.tab-group .active a {
background: #1316FA;
color: #ffffff;
}
.tab-content>div:last-child {
display: none;
}
h1 {
text-align: center;
color: #fff;
font-weight: 300;
margin: 0 0 40px;
}
/*label {
position: absolute;
transform: translateY(6px);
left: 13px;
color: rgba(255,255,255,0.7);
transition: all 0.25s ease;
pointer-events: none;
font-size: 22px;
}
label .req {
margin: 2px;
color: red;
}*/
label.active {
transform: translateY(50px);
left: 2px;
font-size: 0px;
}
label.active .req {
opacity: 0;
}
label.highlight {
color: #000;
margin-top: -10px;
}
input {
font-size: 18px;
display: block;
width: 100%;
height: 100%;
padding: 1px 3px;
background-image: none;
border: 1px solid #fff;
color: #fff;
border-radius: 0;
transition: border-color .25s ease, box-shadow .25s ease;
}
input:focus {
outline: 0;
border-color: #000;
}
.field-wrap input {
padding-left: 40px;
}
.field-wrap i {
position: absolute;
left: 0;
top: -5px;
padding: 9px 8px;
color: silver;
}
.field-wrap {
position: relative;
margin-bottom: 30px;
}
.top-row:after {
content: "";
display: table;
clear: both;
}
.top-row>div {
float: left;
width: 48%;
margin-right: 4%;
}
.top-row>div:last-child {
margin: 0;
}
#sp1 {}
.button {
border: 0;
outline: none;
border-radius: 20px;
padding: 5px 5px;
font-size: 2rem;
font-weight: 50rem;
text-transform: uppercase;
letter-spacing: .1em;
background: rgb(54, 57, 221);
color: #ffffff;
transition: all 0.5s ease;
}
.button:hover,
.button:focus {
background: #1316FA;
}
.button-block {
display: block;
width: 100%;
}
.forgot {
margin-top: -20px;
text-align: right;
margin-bottom: 10px;
}
fieldset.date {
margin: 0;
padding: 0;
padding-left: 20px;
padding-bottom: .5em;
display: block;
border: none;
}
fieldset.date legend {
margin: 0;
padding: 0;
margin-top: .25em;
font-size: 100%;
}
fieldset.date label {
position: absolute;
top: -20em;
left: -200em;
}
fieldset.date select {
margin: 0;
padding: 0;
font-size: 100%;
display: inline;
}
<!DOCTYPE html>
<html>
<head>
<title>Sign-Up/Login Form</title>
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,300,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="form">
<ul class="tab-group">
<li class="tab active">Sign Up</li>
<li class="tab">Log In</li>
</ul>
<div class="tab-content">
<div id="signup">
<form action="" method="post">
<div class="field-wrap">
<input type="text" placeholder="First Name" required autocomplete="off" />
<i class="fa fa-user icon"></i>
</div>
<div class="field-wrap">
<input type="text" placeholder="Last Name" required autocomplete="off" />
<i class="fa fa-user icon"></i>
</div>
<div class="field-wrap">
<input type="email" placeholder="E-mail" required autocomplete="off" />
<i class="fa fa-envelope icon"></i>
</div>
<div class="field-wrap">
<input type="password" placeholder="Password" required autocomplete="off" />
<i class="fa fa-lock icon"></i>
</div>
<div class="field-wrap">
<input type="tel" placeholder="Phone" required autocomplete="off" />
<i class="fa fa-phone icon"></i>
</div>
<div class="field-wrap">
<input type="text" placeholder="Post Code" pattern="[0-9]{5}" required autocomplete="off" />
<i class="fa fa-map-marker icon"></i>
</div>
<!--Problem Region-->
Gender<br>
<div>
<input type="radio" name="gender">Male
<input type="radio" name="gender" />Female
</div>
<fieldset class="date">
<legend>Birthday </legend>
<label for="month_start">Month</label>
<select id="month_start" name="month_start" />
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select> -
<label for="day_start">Day</label>
<select id="day_start" name="day_start" />
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select> -
<label for="year_start">Year</label>
<select id="year_start" name="year_start" />
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
<option>2017</option>
<option>2018</option>
</select>
</fieldset>
<!--Error RegionEnds-->
<button type="submit" class="button button-block" />Register </button>
</form>
</div>
<div id="login">
<img src="./user.png" class="user">
<form action="/" method="post">
<div class="field-wrap">
<input type="email" placeholder="E-mail" required autocomplete="off" />
<i class="fa fa-envelope icon"></i>
</div>
<div class="field-wrap">
<input type="password" placeholder="Password" required autocomplete="off" />
<i class="fa fa-lock icon"></i>
</div>
<p class="forgot">Forgot Password?</p>
<button class="button button-block" />Log In</button>
</form>
</div>
</div>
<!-- tab-content -->
</div>
<!-- /form -->
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src="js/index.js"></script>
</body>
</html>
Your height property in CSS using the input selector is throwing off your markup and causing the radio buttons to expand far past the point you can see them. I would suggest to be more specific with your selectors. Here's code to give you an idea of what's happening and how to fix it:
$('.form').find('input').on('keyup blur focus', function (e) {
var $this = $(this),
label = $this.prev('label');
if (e.type === 'keyup') {
if ($this.val() === '') {
label.removeClass('active highlight');
} else {
label.addClass('active highlight');
}
} else if (e.type === 'blur') {
if( $this.val() === '' ) {
label.removeClass('active highlight');
} else {
label.removeClass('highlight');
}
} else if (e.type === 'focus') {
if( $this.val() === '' ) {
label.removeClass('highlight');
}
else if( $this.val() !== '' ) {
label.addClass('highlight');
}
}
});
$('.tab a').on('click', function (e) {
e.preventDefault();
$(this).parent().addClass('active');
$(this).parent().siblings().removeClass('active');
target = $(this).attr('href');
$('.tab-content > div').not(target).hide();
$(target).fadeIn(600);
});
*{
box-sizing: border-box;
margin:0px;
padding:0px;
}
body {
background:url(../background.jpg);
/*font-family: 'Titillium Web', sans-serif;*/
font-family: 'Roboto', sans-serif;
background-size:cover;
}
.user{
width: 80px;
height: 80px;
border-radius: 50%;
position: relative;
top: -10px;
left: calc(50%-50px);
right: -170px;
}
a {
text-decoration: none;
color: rgb(39, 153, 219);
transition: .5s ease;
}
a:hover {
color: #179b77;
}
.form {
padding: 40px;
max-width: 500px;
margin: 40px auto;
border-radius: 4px;
box-shadow: 0 4px 10px 4px rgba(19, 35, 47, 0.3);
transition: .5s ease;
position: relative;
}
.form:hover {
box-shadow: 0px 0px 40px 16px rgba(18,18,18,1.00);
}
.tab-group {
list-style: none;
padding: 0;
margin: 0 5px 20px 0;
}
.tab-group:after {
content: "";
display: table;
clear: both;
}
.tab-group li a {
display: block;
text-decoration: none;
padding: 15px;
background: #0C0E67;
color: #fff;
font-size: 20px;
float: left;
width: 50%;
text-align: center;
cursor: pointer;
transition: .5s ease;
}
.tab-group li a:hover {
background: #0C0E67;
color: #ffffff;
}
.tab-group .active a {
background:#1316FA;
color: #ffffff;
}
.tab-content > div:last-child {
display: none;
}
h1 {
text-align: center;
color: #fff;
font-weight: 300;
margin: 0 0 40px;
}
/*label {
position: absolute;
transform: translateY(6px);
left: 13px;
color: rgba(255,255,255,0.7);
transition: all 0.25s ease;
pointer-events: none;
font-size: 22px;
}
label .req {
margin: 2px;
color: red;
}*/
label.active {
transform: translateY(50px);
left: 2px;
font-size: 0px;
}
label.active .req {
opacity: 0;
}
label.highlight {
color: #000;
margin-top:-10px;
}
[type="radio"] {
height: 10px;
}
input {
font-size: 18px;
display: block;
width: 100%;
height: 100%;
padding: 1px 3px;
background-image: none;
border: 1px solid #fff;
color: #fff;
border-radius: 0;
transition: border-color .25s ease, box-shadow .25s ease;
}
input:focus{
outline: 0;
border-color: #000;
}
.field-wrap input{
padding-left: 40px;
}
.field-wrap i{
position: absolute;
left:0;
top: -5px;
padding: 9px 8px;
color: silver;
}
.field-wrap {
position: relative;
margin-bottom: 30px;
}
.top-row:after {
content: "";
display: table;
clear: both;
}
.top-row > div {
float: left;
width: 48%;
margin-right: 4%;
}
.top-row > div:last-child {
margin: 0;
}
#sp1{
}
.button {
border: 0;
outline: none;
border-radius: 20px;
padding: 5px 5px;
font-size: 2rem;
font-weight: 50rem;
text-transform: uppercase;
letter-spacing: .1em;
background: rgb(54, 57, 221);
color: #ffffff;
transition: all 0.5s ease;
}
.button:hover, .button:focus {
background: #1316FA;
}
.button-block {
display: block;
width: 100%;
}
.forgot {
margin-top: -20px;
text-align: right;
margin-bottom:10px;
}
fieldset.date {
margin: 0;
padding: 0;
padding-left: 20px;
padding-bottom: .5em;
display: block;
border: none;
}
fieldset.date legend {
margin: 0;
padding: 0;
margin-top: .25em;
font-size: 100%;
}
fieldset.date label {
position: absolute;
top: -20em;
left: -200em;
}
fieldset.date select {
margin: 0;
padding: 0;
font-size: 100%;
display: inline;
}
<!DOCTYPE html>
<html>
<head>
<title>Sign-Up/Login Form</title>
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,300,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="form">
<ul class="tab-group">
<li class="tab active">Sign Up</li>
<li class="tab">Log In</li>
</ul>
<div class="tab-content">
<div id="signup">
<form action="" method="post">
<div class="field-wrap">
<input type="text" placeholder="First Name" required autocomplete="off" />
<i class="fa fa-user icon"></i>
</div>
<div class="field-wrap">
<input type="text" placeholder="Last Name" required autocomplete="off"/>
<i class="fa fa-user icon"></i>
</div>
<div class="field-wrap">
<input type="email" placeholder="E-mail" required autocomplete="off"/>
<i class="fa fa-envelope icon"></i>
</div>
<div class="field-wrap">
<input type="password" placeholder="Password" required autocomplete="off"/>
<i class="fa fa-lock icon"></i>
</div>
<div class="field-wrap">
<input type="tel" placeholder="Phone" required autocomplete="off"/>
<i class="fa fa-phone icon"></i>
</div>
<div class="field-wrap">
<input type="text" placeholder="Post Code" pattern="[0-9]{5}" required autocomplete="off"/>
<i class="fa fa-map-marker icon"></i>
</div>
<!--Problem Region-->
Gender<br>
<div>
<input type="radio" name="gender" >Male
<input type="radio" name="gender" />Female
</div>
<fieldset class="date">
<legend>Birthday </legend>
<label for="month_start">Month</label>
<select id="month_start"
name="month_start" />
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select> -
<label for="day_start">Day</label>
<select id="day_start"
name="day_start" />
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select> -
<label for="year_start">Year</label>
<select id="year_start"
name="year_start" />
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
<option>2017</option>
<option>2018</option>
</select>
</fieldset>
<!--Error RegionEnds-->
<button type="submit" class="button button-block"/>Register </button>
</form>
</div>
<div id="login">
<img src="./user.png" class="user">
<form action="/" method="post">
<div class="field-wrap">
<input type="email" placeholder="E-mail" required autocomplete="off"/>
<i class="fa fa-envelope icon"></i>
</div>
<div class="field-wrap">
<input type="password" placeholder="Password" required autocomplete="off"/>
<i class="fa fa-lock icon"></i>
</div>
<p class="forgot">Forgot Password?</p>
<button class="button button-block"/>Log In</button>
</form>
</div>
</div><!-- tab-content -->
</div> <!-- /form -->
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src="js/index.js"></script>
</body>
</html>
In addition to the height issue that was pointed out. It's a good idea to wrap the radio button inside a label tag. This makes it much easier for a user to interact with since its all clickable...
<label for="myRadioBtn">
<input type="radio" name="myRadioBtn />
<span>Label Text</span>
</label>

Validation for inputs in jquery using regex

i was creating a simple form which has two inputs Name and Email on submit if i write numbers in name input then it will show number is not allowed message as like required message same as in email
Fiddle:https://jsfiddle.net/p6ohxxxe/
please help me out of this problem your help will be appreciated
HTML
<div class="form-container">
<form action="" id="my-form" name="myForm">
<div class="form-row">
<div class="input-container">
<label for="name" class="form-label">Name:</label>
<input type="text" class="form-input" name="name" placeholder="Enter your Name">
</div>
</div>
<div class="form-row">
<div class="input-container">
<label for="Email" class="form-label">Email:</label>
<input type="text" class="form-input" name="email" placeholder="Enter your Email">
</div>
</div>
<div class="form-row">
<div class="input-container">
<button type="submit" class="btnSubmit" >Submit</button>
</div>
</div>
</form>
</div>
js
$("form[name='myForm']").validate({
rules: {
name:"required",
email:{
required:true,
email:true
}
},
messages:{
name:"please Enter your Name",
email:"Please Enter a valid Email Address"
},
submitHandler: function(form) {
form.submit();
}
});
css
.form-container{
position: relative;
width: 100%;
padding: 8px;
box-sizing: border-box;
background: rgba(40, 91, 255, 0.24);
margin:30px auto;
max-width: 50%;
}
.input-container{
width: 100%;
height:auto;
padding-bottom: 12px;
}
.form-label{
font-weight: bold;
margin-bottom: 10px;
font-size: 15px;
display: block;
color:#000;
}
.form-input{
display: block;
width: 50%;
height: 35px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
.form-row{
position: relative;
width:100%;
padding: 14px;
}
.btnSubmit{
padding: 10px 40px;
position: relative;
background: #31708f;
border-radius: 5px;
outline: none;
box-shadow: none;
color: white;
}
.error{
color:red;
border-color: red;
padding: 3px 2px;
}
I dont know if I understand your question, but using the validate plugin, you can create additional validation rules and use regex as the validation parameter. I'm using this code:
jQuery.validator.addMethod("regex", function(value, element, regexp) {
var re = new RegExp(regexp);
return this.optional(element) || re.test(value);
},"Invalid Data");
And input:
<input required="" data-rule-regex="^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$" title="Enter a valid IPV4" name="ip" type="text">

where is this empty space coming from?

I didn't write the form but the css is only 8 lines + bootstraps form control and then some classes for the javascript but I cannot figure out why the place holder text bit, or actually it's parent div, is becoming 60px or so in height, there is only 15px padding top and bottom and then a margin for the placeholder text. I've gone through form-control and there's no styles for height so I just can't figure it out. If you could have a look that'd be great.
http://danceforovariancancer.com.au#perform
Here's the contact form html and it's css but I'd recomend inspecting element because there's no answers in the css as far as I can tell :o
<section id="perform">
<div class="container-fluid apply">
<div class="text-center row">
<h1>Want to perform? Sign up here</h1>
</div>
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<form name="sentMessage" id="contactForm" novalidate>
<div class="col-lg-4">
<div class="row control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label>Name</label>
<input type="text" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Please enter your name.">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="row control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label>Email</label>
<input type="email" class="form-control" placeholder="Email Address" id="email" required data-validation-required-message="Please enter your email address.">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="row control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label>Phone</label>
<input type="tel" class="form-control" placeholder="Phone Number" id="phone" required data-validation-required-message="Please enter your phone number.">
<p class="help-block text-danger"></p>
</div>
</div>
</div>
<div class="col-lg-8">
<div class="row control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label>Message</label>
<textarea rows="5" class="form-control" placeholder="Message" id="message" required data-validation-required-message="Please enter a message."></textarea>
<p class="help-block text-danger"></p>
</div>
</div>
</div>
<br>
<div id="success"></div>
<div class="row">
<div class="form-group col-xs-12">
<button type="submit" class="btn btn-success btn-lg">Send</button>
</div>
</div>
</form>
</div>
</div>
</div>
and css
.apply {
background-color: #0094ab;
}
.form-control {
color: #fff !important;
}
.floating-label-form-group {
position: relative;
margin-bottom: 5px;
margin-top: 5px;
/* padding-bottom: .5em; */
border-bottom: 1px solid #eee;/* color: #0094ab; */
}
.floating-label-form-group input, .floating-label-form-group textarea {
z-index: 1;
color: #fff;
position: relative;
padding-right: 0;
padding-left: 0;
border: 0;
border-radius: 0;
font-size: 1.5em;
background: rgba(255, 255, 255, 0.24);
box-shadow: none!important;
resize: none;
}
.floating-label-form-group label {
display: block;
z-index: 0;
position: relative;
top: 2em;
margin: 0;
font-size: .85em;
line-height: 1.764705882em;
vertical-align: middle;
vertical-align: baseline;
opacity: 0;
-webkit-transition: top .3s ease, opacity .3s ease;
-moz-transition: top .3s ease, opacity .3s ease;
-ms-transition: top .3s ease, opacity .3s ease;
transition: top .3s ease, opacity .3s ease;/* color: #fff; */
}
.floating-label-form-group-with-value label {
top: 0;
opacity: 1;
}
.floating-label-form-group-with-focus label {
color: #80bc18;
}
form .row:first-child .floating-label-form-group {
border-top: 1px solid #eee;
}
.form-control::-moz-placeholder {
color: #999;
opacity: 1;
}
.form-control:-ms-input-placeholder {
color: #999;
}
.form-control::-webkit-input-placeholder {
color: #999;
/* font-size: 12px; */
}
You have hidden labels (opacity:0) which takes the space. Actually Opacity:0 hides the element (here: the labels), but reserves the space. You can use display:none instead, to completely hide an element.
I hope this helps.
As others have said the problem is caused by the hidden label.
If you're looking for a quick fix, here's what I would do:
In your mystyles.css add top margin for .form-control.
.form-control {
margin-top: -10px;
}
Apply following changes
label {
opacity: 1 !important;
top:0 !important;
}
.floating-label-form-group input, .floating-label-form-group textarea {
background: rgba(255, 255, 255, 0.54) none repeat scroll 0 0;
border: 0 none;
border-radius: 3px;
box-shadow: none !important;
color: #fff;
font-size: 1.5em;
padding-left: 5px;
padding-right: 0;
position: relative;
resize: none;
z-index: 1;
}
.form-control {
color: #fff !important;
line-height: 1.5;
}

Categories