Google Form Autocomplete Strange Behavior - html

I hope that this question makes sense. I am developing a website which uses Identity Server 4 for authentication (probably not relevant, but it can't hurt). I have done a lot of testing on the sign in page and naturally Google (specifically Chrome, I assume) provides suggestions for previous entries. I am not very familiar with front end design and have no idea where to start in fixing this issue. I don't mind that there is autocomplete, but as you can see in the attached image, it interacts with the UI very strangely.
I am using Bootstrap 4 btw. Here is the cshtml for the card pictured:
<div class="card-body">
<form class="rounded-lg" asp-route="Login">
<input type="hidden" asp-for="ReturnUrl" />
<div class="form-group">
<input class="form-control custom-input rounded-lg" placeholder="Email or Username" asp-for="Username" required>
</div>
<div class="form-group password">
<input id="password-field" type="password" class="form-control rounded-lg" placeholder="Password" asp-for="Password" required autocomplete="off">
<span id="pass-status" class="fa fa-eye" aria-hidden="true"></span>
</div>
#if (Model.AllowRememberLogin)
{
<div class="form-group">
<div class="form-check">
<input class="form-check-input rounded-sm" asp-for="RememberLogin">
<label class="form-check-label" asp-for="RememberLogin">Remember Me</label>
</div>
</div>
}
<p>Default Username: Admin Password: P#ssword1</p>
<button class="btn btn-lg btn-primary btn-block text-uppercase rounded-pill" name="button" value="login">Sign In</button>
<div class="custom-link">
Or Register a New Account
</div>
</form>
</div>
And here is the css:
#import '../lib/bootstrap/dist/css/bootstrap.min.css';
.custom-input {
height: auto;
}
.custom-link {
padding-top: 15px;
}
.custom-body-container {
margin-top: 10%;
}
.password {
position: relative;
margin-bottom: 10px;
}
.password .fa-eye {
position: absolute;
top: 12px;
right: 12px;
font-size: 15px;
}
.password .fa-eye-slash {
position: absolute;
top: 12px;
right: 12px;
font-size: 15px;
}

As you just mentioned Chrome the solution would be adding the autocomplete property with the value.
autocomplete="chrome-off"
Disabling Chrome Autofill
The behaviour is very different for each browser so you may have to add some conditions if you would like full compatibility.
Firefox use autocomplete="off" instead How do you disable browser Autocomplete on web form field / input tag?

Related

How to make this div transition smoother (as CSS transitions don't seem to work)

Here is the page in action, as you can see, my inputs fade nicely using jquery but no matter what I try I can't seem to get white div to shrink in a smooth manner as apposed to snapping: https://gyazo.com/983cc12230530459ea7c19c5484c53db
Code below:
.logo-margins {
margin: auto!important;
margin-bottom: 20px!important;
display: block!important;
padding-left: 28px;
}
.copyright-text {
font-size: 12px;
}
.step-one-object {
display: block;
}
.step-two-object {
display: none;
}
.center-box {
background: #fbfbfb;
transition: 2s;
padding: 20px;
border-radius: 15px;
}
.center-box2 {
height: 302px!important;
}
<body style="background-color: #0155a4">
<div class="container">
<div class="col-md-12">
<img class="logo-margins" style="width:500px" src=“">
</div>
<div class="col-md-12">
<form class="form-signin" autocomplete="off">
<div class="center-box">
<div class="text-center mb-4 step-one-object">
<p><br />Welcome to the Survey Centre. <br /><br /> To get started, enter the 'Company ID'
issued to you by your local representative, You can also find this ID on the front page of any report created for you by representative</p>
</div>
<div class="form-label-group">
<input type="text" id="inputCompanyId" class="form-control" placeholder="Email address" required autofocus>
<label for="inputCompanyId">Company ID</label>
</div>
<div class="form-label-group step-two-object" id="passwordField">
<input type="password" id="inputPassword" class="form-control" placeholder="Password">
<label for="inputPassword">Password</label>
</div>
<button class="btn btn-lg btn-primary btn-block step-one-object" onclick="advanceStep(event)">Continue</button>
<button class="btn btn-lg btn-primary btn-block step-two-object">Sign In</button>
<p class="mt-5 mb-3 text-muted text-center copyright-text">© Copyright 2018, Intellectual Property </p>
</div>
</form>
</div>
</div>
<script>
function advanceStep(event) {
event.preventDefault();
$(".step-one-object").fadeOut(300);
$(".step-two-object").delay(305).fadeIn(300);
}
</script>
</body>
The aim is to get the white box to shrink smoothly on click of the button while the elements inside also do their animations, ideally finishing at the same time, CSS transitions on the white div seem not to work (I think this is because the CSS on the box isn't actually changing, it's just reacting to the contents changing).
Thanks in advance,
Jake Wilcox
The transition CSS property takes more than just a duration.
If you want center-box to shrink while using transition, you need to choose a property on which it will be applied.
So what you want is to use it like this :
transition: height 2s;
And you also need to change the height property of center-box to 0 when the user clicks on the 'Continue' button.

Custom input style with a icon inside and button in the right

I am trying to get a custom input style have a glyph icon inside and have a button on the right that says go.
Here is my js fiddle with it. jsfiddle
<div class="form-group">
<div class="icon-addon addon-sm">
<input type="text" placeholder="Search All Orders" class="form-control" id="Order Search">
<label for="email" class="glyphicon glyphicon-search" rel="tooltip" title="email"></label>
</div>
</div>
The problem i am having is when i try to add the button on the right it makes the icon disappear when the input is clicked.
Using your fiddle I simply added an absolutely positioned button into your search box. Perhaps this is what you were looking for?
Added button in HTML:
<input type="text" placeholder="Search All Orders" class="form-control" id="Order Search">
<label for="email" class="glyphicon glyphicon-search" rel="tooltip" title="email"></label>
<button class="button-go">go</button>
Button's CSS:
.button-go {
position: absolute;
right: 0;
top: 0;
height: 30px;
}
https://jsfiddle.net/t6295xrd/
Here is a Demo for what i understood from you i just add the button to your fiddle and add this css to position it on right.
#Order_Search {
padding-right:20px;
}
.go-btn {
position: absolute;
right: 3px;
margin-left: -2.5px;
top: 2px
}
and this is the html
<div class="form-group">
<div class="icon-addon addon-sm">
<input type="text" placeholder="Search All Orders" class="form-control" id="Order_Search">
<label for="email" class="glyphicon glyphicon-search" rel="tooltip" title="email"></label>
<button class="go-btn"> Go </button>
</div>

Bootstrap input addon on right side

I have a header-div on my Site. Inside the header I want to have a login-form in-line on the right side.
css:
#header {
position: absolute;
top: 0;
width: 100%;
height: 45px;
padding: 5;
background: #fff;
border-bottom: 1pt solid #ccc;
text-align: right;
font-weight: bold;
}
#header div {
/*display: inline-block;*/
cursor: pointer;
/*padding: 4px;*/
float: right;
text-decoration: none;
font-size: 15px;
margin-right: 5px;
}
#submitButton {
float:right;
}
html:
<div id="header">
<div id="login">
<form class="form-inline" role="form">
<div class="row">
<button type="submit" class="btn btn-default" id="submitButton">Login</button>
<div class="form-group col-sm-3">
<div class="input-group"> <span class="input-group-addon"><i class="fa fa-envelope-o fa-fw"></i></span>
<input type="email" class="form-control" placeholder="Enter email" />
</div>
</div>
<div class="form-group col-sm-3">
<div class="input-group"> <span class="input-group-addon"><i class="fa fa-key fa-fw"></i></span>
<input type="password" class="form-control" placeholder="password" />
</div>
</div>
</div>
</form>
</div>
</div>
That's what I have so far:
http://jsfiddle.net/n5qmc/254/
But if I go in the password form and press TAB I don't get in the email input field. Because of the float:right thing. I need to do this somehow different.
What is the right way to do this? Thanks!
What you need is tabindex but as your html is not good and in bootstrap you have used your own style so tabindex got different behaviour.
I have updated your fiddle with changes in html and css. Please check and let me know if its ok for you..
I have removed float and also removed extra margin which were causing problem now if you will use tab then it will go one by one and also will work better in resizing. I have also changed html so email field will be first in both case.

CSS positioning for close button in form

I've created a search form using bootstrap. I've also used jquery to generate a delete search button (x) when text is input, however, I am stuck trying to get it on the same line as the search form (ideally in the box to the right).
As you can see in the second picture, when "1" is entered into the form the button is generated below the search form. I have included my code below, any help would be greatly appreciated.
<form id="PWFS">
<label for="Label">Info</label>
<button type="button" class="btn btn-link btn-xs"<i class="fa fa-question-circle fa-lg"></i></button>
<div class="row">
<div class="col-md-8">
<div class="input-group btn-group">
<span class="input-group-addon" id="basic-addon1"><i class="fa fa-search"></i></span>
<input type="text" class="form-control search" id="search" placeholder="Workflow #">
<span id="searchclear" class="searchclear fa fa-times"></span>
</div>
</div>
<button id="WFFsearch" type="submit">Search</button>
</div>
</form>
</div>
<br>
CSS
.searchclear {
position: relative;
z-index: 10;
right: 5px;
top: 0;
bottom: 0;
height: 14px;
margin: auto;
font-size: 14px;
cursor: pointer;
color: #ccc;
}
Thank you Lal, Phil and adamdc78. I just had to change the position to absolute.

Input box and checkbox’s heights are different

I made a login box using Bootstrap 3.0.3. On the second line, the password input box’s and check box”s (labelled Auth) heights are different. On mobile, the difference is even more noticeable.
How can I make their heights match?
Bootply
<form name="fhead" method="post" onsubmit="return fhead_submit(this);" autocomplete="off" role="form" class="form-inline">
<div id="outlogin_box" name="outlogin_box">
<input type="hidden" name="url" value="<?=$outlogin_url?>">
<input type="text" class="form-control input-sm" name="mb_id" maxlength="20" itemname="id" placeholder="login id">
<div class="input-group"><!-- needs height alignment -->
<input type="password" class="form-control input-sm" name="mb_password" id="outlogin_mb_password" maxlength="20" itemname="password" placeholder="password">
<span class="input-group-addon">
<div class="checkbox">
<label>
<input type="checkbox" name="auto_login" title="Remember me" value="1" onclick="if (this.checked) { if (confirm('자동로그인을 사용하시면 다음부터 회원아이디와 패스워드를 입력하실 필요가 없습니다.\n\n\공공장소에서는 개인정보가 유출될 수 있으니 사용을 자제하여 주십시오.\n\n자동로그인을 사용하시겠습니까?')) { this.checked = true; } else { this.checked = false; } }">
Auto
</label>
</div>
</span>
</div>
<div class="input-group">
<button type="submit" class="btn btn-success btn-sm btn-group-justified" >Login</button>
</div>
<div class="input-group">
<div class="btn-group btn-group-justified">
<a class="btn btn-default btn-sm" title="Register" href="<?=$g4[bbs_path]?>/register.php">Register</a>
<a class="btn btn-default btn-sm" title="회원 id, password 찾기" href="javascript:win_password_lost();">아이디찾기</a>
</div>
</div>
</div>
</form>
Change
<input class="form-control input-sm" name="mb_password" ...
to
<input class="form-control" name="mb_password" ...
http://www.bootply.com/98872
You have modified the height of the input by adding a class "input-sm".
Try this very simple:
input[type=checkbox], input[type=radio] {
vertical-align: middle;
position: relative;
bottom: 1px;
}
input[type=radio] {
bottom: 2px;
}
You can set fixed width and height values for HTML textboxes/checkboxes in CSS by doing the following...
input[type="text"] {
width: 10%;
height:3%;
}
input[type="password"] {
width: 10%;
height:3%;
}
input[type="checkbox"] {
height:2%;
}
You can also set them using px instead of percentages.
Hopefully setting a fixed height and width should resolve your conflicting size problems.
Try overriding bootstrap CSS with this:
.input-group-addon .checkbox {
margin: 8px 5px 0 !important;
}
.input-group-addon {
padding:0 !important;
}
change your css of checkbox class display which is display : inline-block to display: inline and the try it
.form-inline .radio,.form-inline .checkbox{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}
to
.form-inline .radio,.form-inline .checkbox{display:inline;padding-left:0;margin-top:0;margin-bottom:0}
in bootstrap.min.css