How to show ** when typing password? - html

I create a Jsp page for log in - user name + password. However, when I am typing password it is showing on text box. Can anybody help me, how can I do this, when I type password it will show ** .Thanks in advance.

You should use <input type="password"> instead of <input type="text">.
See also:
HTML tutorial - Forms

Related

HTML - how to clear data validation once error has been removed

I am making a cloud page and have set an alphabetic data validation in html which is working fine in that a user cannot enter anything other than letters.
The issue I am now having is that the data validation doesn't go when the error has been corrected i.e. the user cannot submit the page.
The code snippet is below. Please can someone give me a steer on how to rectify this? I have tried onblur but it didn't work.
Thanks in advance!
<input pattern="[A-Za-z\s]*" oninvalid="setCustomValidity('Please enter your first name')" name="Firstname" class="answer_box" placeholder="Enter your first name">
With setCustomValidity() the field is invalid. You have to clear the validation:
oninput="setCustomValidity('')"
As mentioned in this documentation.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity

How to not change page when the login fields are empty

i'm adding a login system to my website i've figured out how to change pages but even if my login fields are empty when i click on my login button it changes page like i'm logged in while i'm not. Before adding the a href='index.html' when i was clicking the login button the site told me that i needed to fill the login field but now when i click even if the field are empty there's no error message and it changes page.
sorry if my explanations are a bit messy if you need more infos tell me ! :)
here's my code :
<form>
<input type="email" class="input-box" placeholder="Email" required>
<input type="password" class="input-box" placeholder="Password" required>
<button type="submit" class="submit-btn">Login</button>
<input type="checkbox"><span>remember me</span>
</form>
You can use several options to fix your problem.
As some others already suggested you can use JavaScript to validate the content of your input field. This is only on the client and wil leave your server still vulnerable to attacks. You should do a server validation too, with PHP for example and to be 100% safe a constraint validation for the database.
You could simple set constraint inside the HTML Tags:
(min-length, max-length, pattern(RegEx))
and so on.
Check the W3Schools site for more detailed information.
I would still use the aditional option from 1) to be safe!

How to disable autofill in chrome v72.0.3626.109 non-input password

After update chrome to version 72.0.3626.109, tag autocomplete off stopped work,
I'm trying use autocomplete='somestring', but not work.
Follow the image:
I tried autocomplete="false", autocomplete="off" and plugin for disable autofill, use jQuery to add attribute autocomplete, but not worked!
Sorry for my english.
I struggled with something very similar and found this question while I was searching for answers, here's how I fixed it.
My situation: I have an input field for searching, and somewhere else I had a username and password field. Chrome recently started putting the autocompleted username in the search field.
Apparently, Chrome ignores autocomplete="off" now, and goes by the string value to try to determine what type of data to autocomplete. So if you have a search box, you should put autocomplete="search" so Chrome won't put the username in there, for example.
When I first noticed a long time ago autocomplete="off" was being ignored for my search box, I switched to autocomplete="search" and that worked. Now, Chrome started putting the username in the search box again with the latest update.
The way to fix this, if your situation is similar, is to put the autocomplete field for all of your text inputs with a string describing what it is.
BEFORE:
<input id='search' type='text' autocomplete="search">
And somewhere else on the page...
<input id='login_username' type='text'>
<input id='login_password' type='password'>
AFTER
<input id='search' type='text' autocomplete="search">
And somewhere else on the page...
<input id='login_username' type='text' autocomplete="username">
<input id='login_password' type='password' autocomplete="password">
Additionally, putting the inputs in a form also affects the autocomplete, but I didn't have too much time to mess with that and I needed a quick fix to get my site working properly again. Hope this helps someone.

How to check password while typing

i want to build a website and need to make a change password site. How can i check the password while typing?
See this example with the infobox at the right side.
I use Angular2 and want to do that with typescript.
Angular has built in capabilities to validate input. You could use a regular expression to validate the password:
<div>
<input placeholder="Enter your password" [(ngModel)]="password" #pwField="ngModel" type="password" pattern="[a-zA-Z]*[0-9]+[a-zA-Z]*">
</div>
<div *ngIf="!pwField.valid">Your password should contain at least one digit.</div>
Here's a start to what you're trying - http://www.w3schools.com/angular/tryit.asp?filename=try_ng_intro

Encrypting a textfield in HTML

I have a text field in my HTML project that I want to encrypt as a password.
So basicaslly instead of this being displayed in the text field:
mypassword
I want it to say:
*********
or something close to that.
So basically just making the text that the user inputs not to be visible.
How do I do this?
Use <input type="password" />
You're looking for <input type="password" />.
Note that this has nothing to do with encryption.
This has nothing to do with encryption, it's just a form field type, you can use the following:
<input type="password" name="password"/>
However, uploading whatever is entered in here when the user submits will send it plainly across the internet unless you're using HTTPS with a valid SSL certificate, which will encrypt all communications between the user and your site and is recommended for anything with a login.
You can use < input type="password" > like this to hide your password with stars.but it is not enough when you upload your password .you should use PHP or something else
Just put this in your existing code where you put your textbox
<input type="password" name="password"/>
This will not let you see what you enter and code it with stars, as default.