Prevent input data from showing in url - Flask - html

I am gathering customer data from a web app - however once data is input the data displays in the URL search bar and I am just wondering about how to prevent that from happening?
here is my current code:
<form>
<div class="row">
<div class="col-75">
<div class="container">
<form action="/action_page.php", method="POST">
<div class="row">
<div class="col-50">
<h3>Billing Address</h3>
<label for="fname"><i class="fa fa-user"></i> Full Name</label>
<input type="text" id="fname" name="firstname" placeholder="John M. Doe">
<label for="email"><i class="fa fa-envelope"></i> Email</label>
<input type="text" id="email" name="email" placeholder="john#example.com">
<label for="adr"><i class="fa fa-address-card-o"></i> Address</label>
<input type="text" id="adr" name="address" placeholder="1234 Example Street, Richmond">
<label for="city"><i class="fa fa-institution"></i> Suburb</label>
<input type="text" id="city" name="city" placeholder="Melbourne">
<div class="row">
<div class="col-50">
<label for="state">State</label>
<input type="text" id="state" name="state" placeholder="Victoria">
</div>
<div class="col-50">
<label for="postcode">Post Code</label>
<input type="text" id="postcode" name="postcode" placeholder="3934">
</div>
</div>
</div>
<div class="col-50">
<h3>Payment</h3>
<label for="fname">Accepted Cards</label>
<div class="icon-container">
<i class="fa fa-cc-visa" style="color:navy;">Visa</i>
<i class="fa fa-cc-amex" style="color:blue;">Amex</i>
<i class="fa fa-cc-mastercard" style="color:red;">Mastercard</i>
</div>
<label for="cname">Name on Card</label>
<input type="text" id="cname" name="cardname" placeholder="John More Doe">
<label for="ccnum">Credit card number</label>
<input type="text" id="ccnum" name="cardnumber" placeholder="1111-2222-3333-4444">
<label for="expmonth">Exp Month</label>
<input type="text" id="expmonth" name="expmonth" placeholder="September">
<div class="row">
<div class="col-50">
<label for="expyear">Exp Year</label>
<input type="text" id="expyear" name="expyear" placeholder="2018">
</div>
<div class="col-50">
<label for="cvv">CVV</label>
<input type="text" id="cvv" name="cvv" placeholder="352">
</div>
</div>
</div>
</div>
<label>
<input type="checkbox" checked="checked" name="sameadr"> Shipping address same as billing
</label>
<input type="submit" value="Continue to checkout" class="btn">
</form>
</div>
</div>
.row {
display: -ms-flexbox; /* IE10 */
display: flex;
-ms-flex-wrap: wrap; /* IE10 */
flex-wrap: wrap;
margin: 0 -16px;
}
.col-25 {
-ms-flex: 25%; /* IE10 */
flex: 25%;
}
.col-50 {
-ms-flex: 50%; /* IE10 */
flex: 50%;
}
.col-75 {
-ms-flex: 75%; /* IE10 */
flex: 75%;
}
.col-25,
.col-50,
.col-75 {
padding: 0 16px;
}
.container {
background-color: #f2f2f2;
padding: 5px 20px 15px 20px;
border: 1px solid lightgrey;
border-radius: 3px;
}
input[type=text] {
width: 100%;
margin-bottom: 20px;
padding: 12px;
border: 1px solid #ccc;
border-radius: 3px;
}
label {
margin-bottom: 10px;
display: block;
}
.icon-container {
margin-bottom: 20px;
padding: 7px 0;
font-size: 24px;
}
.btn {
background-color: #04AA6D;
color: white;
padding: 12px;
margin: 10px 0;
border: none;
width: 100%;
border-radius: 3px;
cursor: pointer;
font-size: 17px;
}
.btn:hover {
background-color: #45a049;
}
span.price {
float: right;
color: grey;
}
/* Responsive layout - when the screen is less than 800px wide, make the two columns stack on top of each other instead of next to each other (and change the direction - make the "cart" column go on top) */
#media (max-width: 800px) {
.row {
flex-direction: column-reverse;
}
.col-25 {
margin-bottom: 20px;
}
}
Any help would be really appreciated :)

You have an unnecessary <form> tag on the first line of your HTML and you are missing a closing </div> tag at the end. Changing this seems to resolve the issue:
<div class="row">
<div class="col-75">
<div class="container">
<form action="/action_page.php" , method="POST">
<div class="row">
<div class="col-50">
<h3>Billing Address</h3>
<label for="fname"><i class="fa fa-user"></i> Full Name</label>
<input type="text" id="fname" name="firstname" placeholder="John M. Doe">
<label for="email"><i class="fa fa-envelope"></i> Email</label>
<input type="text" id="email" name="email" placeholder="john#example.com">
<label for="adr"><i class="fa fa-address-card-o"></i> Address</label>
<input type="text" id="adr" name="address" placeholder="1234 Example Street, Richmond">
<label for="city"><i class="fa fa-institution"></i> Suburb</label>
<input type="text" id="city" name="city" placeholder="Melbourne">
<div class="row">
<div class="col-50">
<label for="state">State</label>
<input type="text" id="state" name="state" placeholder="Victoria">
</div>
<div class="col-50">
<label for="postcode">Post Code</label>
<input type="text" id="postcode" name="postcode" placeholder="3934">
</div>
</div>
</div>
<div class="col-50">
<h3>Payment</h3>
<label for="fname">Accepted Cards</label>
<div class="icon-container">
<i class="fa fa-cc-visa" style="color:navy;">Visa</i>
<i class="fa fa-cc-amex" style="color:blue;">Amex</i>
<i class="fa fa-cc-mastercard" style="color:red;">Mastercard</i>
</div>
<label for="cname">Name on Card</label>
<input type="text" id="cname" name="cardname" placeholder="John More Doe">
<label for="ccnum">Credit card number</label>
<input type="text" id="ccnum" name="cardnumber" placeholder="1111-2222-3333-4444">
<label for="expmonth">Exp Month</label>
<input type="text" id="expmonth" name="expmonth" placeholder="September">
<div class="row">
<div class="col-50">
<label for="expyear">Exp Year</label>
<input type="text" id="expyear" name="expyear" placeholder="2018">
</div>
<div class="col-50">
<label for="cvv">CVV</label>
<input type="text" id="cvv" name="cvv" placeholder="352">
</div>
</div>
</div>
</div>
<label>
<input type="checkbox" checked="checked" name="sameadr"> Shipping address same as billing
</label>
<input type="submit" value="Continue to checkout" class="btn">
</form>
</div>
</div>
</div>
(Note: my editor may have formatted your code differently to the original question)

Related

Why are my stepUp/stepDown buttons submitting the form with each click

Not sure if it's the way my HTML is laid out or the way the stepUp / stepDown functions work, but for some reason clicking on the buttons automatically submits the form, stopping only if any other fields don't have valid inputs. Obviously this wouldn't be desired behavior for any form.
Here's a fiddle: http://jsfiddle.net/asa9ohan/1nr2g5zb/38/
input[type="number"] {
appearance: textfield;
text-align: center;
height: 1.5rem;
}
button {
height: 1.5rem;
width: 3rem;
}
<form id="contact-form" action="#" method="post">
<div class="form-field">
<label for="name-input">name <span>*</span><br></label>
<input id="name-input" type="text" required>
</div>
<div class="form-field">
<label for="phone-num-input">phone number <span>*</span><br></label>
<input id="phone-num-input" type="tel" required>
</div>
<div class="form-field">
<label for="email-input">email<br></label>
<input id="email-input" type="email">
</div>
<div class="form-field number-input">
<label for="count-input">count<br></label>
<div>
<button onclick="this.parentNode.querySelector('#count-input').stepDown()" >-</button>
<input id="count-input" min="0" value="0" type="number">
<button onclick="this.parentNode.querySelector('#count-input').stepUp()" class="plus">+</button>
</div>
</div>
<div class="form-field">
<label for="inq-content-input">message <span>*</span><br></label>
<textarea id="inq-content-input" required></textarea>
</div>
<div class="submit-form-button">
<button type="submit" class="button button-form-submit">send</button>
</div>
</form>
Add a return false to your button scripts to avoid the buttons to submit the form:
input[type="number"] {
appearance: textfield;
text-align: center;
height: 1.5rem;
}
button {
height: 1.5rem;
width: 3rem;
}
<form id="contact-form" action="#" method="post">
<div class="form-field">
<label for="name-input">name <span>*</span><br></label>
<input id="name-input" type="text" required>
</div>
<div class="form-field">
<label for="phone-num-input">phone number <span>*</span><br></label>
<input id="phone-num-input" type="tel" required>
</div>
<div class="form-field">
<label for="email-input">email<br></label>
<input id="email-input" type="email">
</div>
<div class="form-field number-input">
<label for="count-input">count<br></label>
<div>
<button onclick="this.parentNode.querySelector('#count-input').stepDown();return false" >-</button>
<input id="count-input" min="0" value="0" type="number">
<button onclick="this.parentNode.querySelector('#count-input').stepUp();return false" class="plus">+</button>
</div>
</div>
<div class="form-field">
<label for="inq-content-input">message <span>*</span><br></label>
<textarea id="inq-content-input" required></textarea>
</div>
<div class="submit-form-button">
<button type="submit" class="button button-form-submit">send</button>
</div>
</form>
A slightly "cleaner" approach would be the following:
const cntr=document.getElementById("count-input");
document.querySelectorAll("button")
.forEach((b,i)=>b.onclick=ev=>(i>2 || cntr[["stepDown","stepUp"][i]](),false) )
input[type="number"] {
appearance: textfield;
text-align: center;
height: 1.5rem;
}
button {
height: 1.5rem;
width: 3rem;
}
<form id="contact-form" action="#" method="post">
<div class="form-field">
<label for="name-input">name <span>*</span><br></label>
<input id="name-input" type="text" required>
</div>
<div class="form-field">
<label for="phone-num-input">phone number <span>*</span><br></label>
<input id="phone-num-input" type="tel" required>
</div>
<div class="form-field">
<label for="email-input">email<br></label>
<input id="email-input" type="email">
</div>
<div class="form-field number-input">
<label for="count-input">count<br></label>
<div>
<button>-</button>
<input id="count-input" min="0" value="0" type="number">
<button>+</button>
</div>
</div>
<div class="form-field">
<label for="inq-content-input">message <span>*</span><br></label>
<textarea id="inq-content-input" required></textarea>
</div>
<div class="submit-form-button">
<button type="submit" class="button button-form-submit">send</button>
</div>
</form>
It turns out if I use div instead of button tags, it prevents the form from being submitted. I'd have to style the buttons independently, but the default button style would need restyling anyway.
input[type="number"] {
appearance: textfield;
text-align: center;
height: 1.5rem;
}
.number-input > div {
display: flex;
}
.button {
height: 1.5rem;
width: 3rem;
background: lightgray;
text-align: center;
border: 1px solid gray;
user-select: none;
}
.button:active { background: darkgray; }
<form id="contact-form" action="#" method="post">
<div class="form-field">
<label for="name-input">name <span>*</span><br></label>
<input id="name-input" type="text" required>
</div>
<div class="form-field">
<label for="phone-num-input">phone number <span>*</span><br></label>
<input id="phone-num-input" type="tel" required>
</div>
<div class="form-field">
<label for="email-input">email<br></label>
<input id="email-input" type="email">
</div>
<div class="form-field number-input">
<label for="count-input">count<br></label>
<div>
<div onclick="this.parentNode.querySelector('#count-input').stepDown()" class="button minus">-</div>
<input id="count-input" min="0" value="0" type="number">
<div onclick="this.parentNode.querySelector('#count-input').stepUp()" class="button plus">+</div>
</div>
</div>
<div class="form-field">
<label for="inq-content-input">message <span>*</span><br></label>
<textarea id="inq-content-input" required></textarea>
</div>
<div class="submit-form-button">
<button type="submit" class="button button-form-submit">send</button>
</div>
</form>

Read-only form alignment needs to be consistent

I have a bit of an issue getting some of my form inputs to align well because they are read-only and hence do not take the same dimensions as the actual visible inputs. I've supplied two images to help you see:
UNALIGNED FORM SECTON
ALIGNED FORM SECTION
label[class="statlabel"] {
font-family: "Amaranth", sans-serif;
display: inline-block;
float: left;
width: 250px;
text-align: right;
padding-right: 10px;
clear: left;
padding-top: 15px;
}
.input CSS
.input {
font-size: 20px;
color: #5a5854;
background-color: #f2f2f2;
border: 1px solid #bdbdbd;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
padding: 5px 5px 5px 30px;
background-repeat: no-repeat;
background-position: 8px 9px;
display: inline-block;
margin-bottom: 10px;
text-indent: 15px;
width: 250px;
}
<a name="personalInfo"></a>
<h5 class="stath5"><span class="badge badge-secondary">2.</span> Please review your personal information</h5>
<EditForm Model="#Data.PersonalInfo" style="max-width:800px;" onkeydown="javascript: DisableEnterKey();">
<label id="fullNameLabel" class="statlabel" for="fullName">Full name:</label>
<span class="nameLabel"><label id="fullName">#Data.PersonalInfo.FullName</label></span>
<br />
<label id="statusLabel" class="statlabel" for="communityStatus">Spanish Lookout Community status:</label>
<span class="statuslabel"><label id="slcStatus">#Data.PersonalInfo.SLCStatus</label></span>
<br />
<label id="boxNumLabel" class="statlabel" for="boxNum">Box Number:</label>
<span class="boxLabel"><label id="boxNum">#Data.PersonalInfo.BoxNumber</label></span>
<br />
<div class="input-container">
<label class="statlabel" for="phone">Phone Number:</label>
<InputText type="tel" id="phone" class="input" #bind-Value="#Data.PersonalInfo.Phone" placeholder="What's your phone number?" />
</div>
<br /><hr class="statHR" />
<div class="input-container1">
<label class="statlabel" for="email">Email <span class="badge badge-success">Optional</span>:</label>
<InputText type="email" id="email" class="input" #bind-Value="#Data.PersonalInfo.Email" placeholder="What's your email address?" />
</div>
</EditForm>
</div>
To clarify, I want the first image to look like the second image. Any help would be invaluable. Thanks for your time!
this should get you started. Use Flex!
.row{
display:flex;
align-items:center;
border:solid black 1px;}
label{
width:25vw;}
EditForm{
display:flex;
flex-direction:column;
}
hr{
width:100%;}
<a name="personalInfo"></a>
<h5 class="stath5"><span class="badge badge-secondary">2.</span> Please review your personal information</h5>
<EditForm Model="#Data.PersonalInfo" style="max-width:800px;" onkeydown="javascript: DisableEnterKey();">
<div class='row'>
<label id="fullNameLabel" class="statlabel" for="fullName">Full name:</label>
<span class="nameLabel"><label id="fullName">#Data.PersonalInfo.FullName</label></span>
</div>
<div class='row'>
<label id="statusLabel" class="statlabel" for="communityStatus">Spanish Lookout Community status:</label>
<span class="statuslabel"><label id="slcStatus">#Data.PersonalInfo.SLCStatus</label></span>
</div>
<div class='row'>
<label id="boxNumLabel" class="statlabel" for="boxNum">Box Number:</label>
<span class="boxLabel"><label id="boxNum">#Data.PersonalInfo.BoxNumber</label></span>
</div>
<div class='row'>
<div class="input-container">
<label class="statlabel" for="phone">Phone Number:</label>
<input type="tel" id="phone" class="input" #bind-Value="#Data.PersonalInfo.Phone" placeholder="What's your phone number?" />
</div></div>
<div class='row'>
<hr class="statHR" />
</div>
<div class='row'>
<div class="input-container1">
<label class="statlabel" for="email">Email <span class="badge badge-success">Optional</span>:</label>
<input type="email" id="email" class="input" #bind-Value="#Data.PersonalInfo.Email" placeholder="What's your email address?" />
</div>
</div>
</EditForm>
</div>

Bootstrap form - scroll does not appear when screen is resized

I'm working on a project with a Bootstrap form. Very simply, I would like the form to have a scroll bar when the window is resized. I tried adding the overflow-auto class to my div, but that doesn't work for it. So when I resize my window, no scroll appears. Here's my code.
.form-container {
border-radius: 25px;
border: 1px solid black;
padding: 15px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.register-container { max-width: 500px; }
.title-header {
font-size: 25px;
font-weight: bold;
}
<div class="overflow-auto container form-container register-container">
<h1 class="title-header">REGISTER</h1>
<form id="register" method="post" action="register">
<?php writeMessageBoxIfMessage($message); ?>
<div class="form-group row">
<div class="col-sm-6">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">FIRST NAME</label> <br>
<input id="firstname" name="firstname" maxlength="80" required>
</div>
<div class="col-sm-6">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">LAST NAME</label> <br>
<input id="lastname" name="lastname" maxlength="80" required>
</div>
<div class="col-sm-12">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">EMAIL</label> <br>
<input type="email" id="email" name="email" maxlength="255" required>
</div>
<div class="col-sm-12">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">PASSWORD</label> <br>
<input type="password" id="password" name="password" maxlength="80" required>
</div>
<div class="col-sm-12">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">CONFIRM PASSWORD</label> <br>
<input type="password" id="confirm-password" name="confirm-password" maxlength="80" required>
</div>
<div class="col-sm-6">
Already have an account? <br> Click here</span> to login.
</div>
<div class="col-sm-6">
<input id="register" type="submit" name="submit"
value="REGISTER" />
</div>
</div>
</form>
</div>
Can anyone provide some suggestions so I can get this to scroll?
Can’t replicate this at the moment but try using
position: absolute;
and give a container
position: relative;
Rather than using the ‘fixed’ position.
Let me know if this doesn’t work.
I hope you want internal scroll if the form is more in height.
Use the following CSS,
Try it.
#register {
max-height: 200px;
overflow: scroll;
}
Please add media
#media (max-height: 420px) {
#register {
height: 150px;
overflow-x: hidden;
overflow-y: scroll;
}
}
for better solution and check your device height should be (max-height: yourDeviceHeight) in media
.form-container {
border-radius: 25px;
border: 1px solid black;
padding: 15px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.register-container { max-width: 500px; }
.title-header {
font-size: 25px;
font-weight: bold;
}
#media (max-height: 420px) {
#register {
height: 150px;
overflow-x: hidden;
overflow-y: scroll;
}
}
<div class="overflow-auto container form-container register-container">
<h1 class="title-header">REGISTER</h1>
<form id="register" method="post" action="register">
<?php writeMessageBoxIfMessage($message); ?>
<div class="form-group row">
<div class="col-sm-6">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">FIRST NAME</label> <br>
<input id="firstname" name="firstname" maxlength="80" required>
</div>
<div class="col-sm-6">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">LAST NAME</label> <br>
<input id="lastname" name="lastname" maxlength="80" required>
</div>
<div class="col-sm-12">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">EMAIL</label> <br>
<input type="email" id="email" name="email" maxlength="255" required>
</div>
<div class="col-sm-12">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">PASSWORD</label> <br>
<input type="password" id="password" name="password" maxlength="80" required>
</div>
<div class="col-sm-12">
<label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm">CONFIRM PASSWORD</label> <br>
<input type="password" id="confirm-password" name="confirm-password" maxlength="80" required>
</div>
<div class="col-sm-6">
Already have an account? <br> Click here</span> to login.
</div>
<div class="col-sm-6">
<input id="register" type="submit" name="submit"
value="REGISTER" />
</div>
</div>
</form>
</div>

justify-content space-between not aligning elements left and right

Alright, so I am trying to use Flexbox to align my form on the left hand side of the screen and my image on the right hand of the screen using justify-content: space-between but when I put that on my .container it doesn't work. Here is what I have so far:
<form>
<div class="heading">
<h1 class="callout">Send Us A Message!</h1>
</div>
<div class="container">
<div class="form-group">
<label>First Name</label>
<input type="text" class="form-control" name="firstname">
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" class="form-control" name="lastname">
</div>
<div class="form-group">
<label>Phone Number</label>
<input type="text" class="form-control" name="phonenumber">
</div>
<div class="form-group">
<label>Email Address</label>
<input type="email" class="form-control" name="email">
</div>
<div class="form-group">
<label>Message</label>
<textarea name="message" cols="30" rows="10">
</textarea>
<button class="btn-1">Send</button>
</div>
<div class="image">
<img src="img/city.jpg" alt="">
</div>
</div>
</form>
My style:
.container {
display: flex;
justify-content: space-between;
flex-direction: column;
}
img {
width: 20%;
}
Put the two sections in their own containers, then it can work.
.container {
display: flex;
justify-content: space-between;
}
section:first-child {
background-color: orange;
}
section:last-child {
background-color: lightgreen;
}
.image {
border: 2px dashed black;
height: 100px;
width: 100px;
}
<form>
<div class="heading">
<h1 class="callout">Send Us A Message!</h1>
</div>
<div class="container">
<section><!-- container one -->
<div class="form-group">
<label>First Name</label>
<input type="text" class="form-control" name="firstname">
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" class="form-control" name="lastname">
</div>
<div class="form-group">
<label>Phone Number</label>
<input type="text" class="form-control" name="phonenumber">
</div>
<div class="form-group">
<label>Email Address</label>
<input type="email" class="form-control" name="email">
</div>
<div class="form-group">
<label>Message</label>
<textarea name="message" cols="30" rows="10">
</textarea>
<button class="btn-1">Send</button>
</div>
</section>
<section><!-- container two -->
<div class="image"> image
<img src="img/city.jpg" alt="">
</div>
</section>
</div>
</form>

Shrinking html items to match screen-size?

I have a page that includes a large vertical form and I need it to be resized depending on the screen size. I want the form inputs to shrink with adequate margins on both the left and right side. My css consists of code like:
.container-register input#search, select {
width: 300px;
}
This makes the initial input widths fairly long so I have tried using #media (max-width) scripts to change the length but it looks very hardcoded. I want it to seamlessly change depending on the viewport without me having to use these #media scripts for every possible viewport width. I was thinking maybe something like flex? However I was having trouble using it.
<div class="body-content-register">
<div class="wrapper">
<center><section id="bg" class="zoom-register">
<div class="box-register">
<center><h1>Register</h1></center>
<form class="register">
<div class="container-register">
<span class="icon"><i class="fa fa-user"></i></span>
<input type="search" name="fullname" id="search" placeholder="Full Name">
</div><br><br><br><br>
<div class="container-register">
<span class="icon"><i class="fa fa-envelope"></i></span>
<input type="search" id="search" placeholder="Email">
</div><br><br><br><br>
<div class="container-register">
<span class="icon"><i class="fa fa-user"></i></span>
<input type="search" id="search" placeholder="Username">
</div><br><br><br><br>
<div class="container-register">
<span class="icon"><i class="fa fa-birthday-cake"></i></span>
<input type="search" id="search" placeholder="Date of Birth">
</div><br><br><br><br>
<div class="container-register">
<span class="icon"><i class="fa fa-map-marker"></i></span>
<input type="search" id="search" placeholder="Postcode">
</div><br><br><br><br>
<div class="container-register">
<span class="icon"><i class="fa fa-key"></i></span>
<input type="search" id="search" placeholder="Password">
</div><br><br><br><br>
<div class="container-register">
<span class="icon"><i class="fa fa-key"></i></span>
<input type="search" id="search" placeholder="Confirm Password">
</div><br><br><br><br>
<div class="float-middle">
<input type="checkbox" name="checkbox" value="checkbox"> Do you accept our terms & conditions?<br>
</div><br>
<button class="button"><strong>Submit</strong></button>
</form>
</div>
</section></center>
</div>
</div>
Besides using media queries you can use intrinsic units of measurement like vw and vh. Not related to the question but I feel I should point out that #ID must be unique so you can't have every element have id='search'. The type attribute of an <input> determines its behavior so type="search" isn't really what you need. Also there are more suitable tags that you could use other than <div> and <span>, but that's purely optional. I changed the layout a bit to reflect what I previously mentioned.
Demo
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
main {
width: 100vw;
height: 100vh;
}
.icon {
display: inline-block;
margin: 0 0 2vw 2vh;
}
h3 {
margin: 0
}
.line {
border: 0;
width: 96vw;
margin: 0;
padding: 0
}
i {
width: 3vw;
margin: 0 1vw 0 0;
}
.name {
display: block
}
#fullName {
width: 86vw;
}
input {
font: inherit;
width: 39vw;
}
.DOB input {
width: 12vw;
text-align: center;
}
.disclosure {
display: block;
margin: 2vh auto 0;
width: 80vw;
}
#accept {
width: 3vw;
}
[type=submit] {
width: 16vw
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<main>
<form id='register'>
<fieldset id="bg">
<legend>
<h3>
Register
</h3>
</legend>
<label class="icon name"><i class="fa fa-user"></i>
<input type="text" id="fullName" name="fullName" placeholder="Full Name"></label>
<fieldset class='line'>
<label class="icon email"><i class="fa fa-envelope"></i>
<input type="email" id="email" placeholder="Email"></label>
<label class="icon user"><i class="fa fa-user"></i>
<input type="text" id="userName" name="userName" placeholder="Username"></label>
</fieldset>
<fieldset class='line'>
<label class='icon DOB'> <i class="fa fa-birthday-cake"></i>
<input type="number" id="DOBmonth" name="DOBmonth" placeholder="Month" min='1' max='12'>
<input type="number" id="DOBday" name="DOBday" placeholder="Day" min='1' max='31'>
<input type="number" id="DOByear" name="DOByear" placeholder="Year" min='1900' max='2000'></label>
<label class="icon country"><i class="fa fa-map-marker"></i>
<input type="text" id="country" name='country' placeholder="Country"></label>
</fieldset>
<label class="icon pass"><i class="fa fa-key"></i>
<input type="password" id="pass" placeholder="Password">
<input type="password" id="confirm" placeholder="Confirm Password">
</label>
</fieldset>
<label class='disclosure'>
<input type="checkbox" id='accept' name="accept" value="accept"> Do you accept our terms & conditions?
<input type="submit"></label>
</form>
</main>