How to check password while typing - html

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

Related

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!

Is there a way to show a password while you type it in a textbox in mvc5

i want to have be able to view my password as i type it is there a way to do that in mvcc5
Its pure HTML there. If you use
<input type="password">
the browser will automatically hide what you're typing. If you want to be able to see what is being typed, you chould change to
<input type="text">
If you're using Razor, its probably just changing from #Html.Password or #Html.PasswordFor to #Html.TextBoxor #Html.TextBoxFor

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.

How to show ** when typing password?

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

How do I suppress firefox password field completion?

I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form to change a password. How can i prevent Firefox from automatically filling out these fields? I already tried giving them different names and ids.
Edit: Someone has already asked this. Thanks Joel Coohorn.
From Mozilla's documentation
<form name="form1" id="form1" method="post" autocomplete="off"
action="http://www.example.com/form.cgi">
[...]
</form>
http://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion
The autocomplete="off" method doesn't work for me. I realized firefox was injecting the saved password in the first password field it encountered, so the solution that worked for me was to create a dummy password field before the password update field and hide it. Like so:
<input type="password" style="display: none;" />
<input type="password" name="password_update" />
Have you tried adding the autocomplete="off" attribute in the input tag? Not sure if it'll work, but it is worth a try.
are all your input boxes set to type=password? That would do it. One of the things you can do, and I'm not at all sure that this is the best answer is to leave input box as an input type and just use javascript and onkeydown event to place stars in the input box instead of having the browser render it. Firefox won't pre-fill that.
As an aside, I have had to work on single-page web-apps and I absolutely hate it. Why would you want to take away the user's ability to bookmark pages? To use the back button?
Adding to this answer https://stackoverflow.com/a/30897967/1333247
This is in case you also have a User field in front of the password fields and want to disable autocompletion for it too (e.g. router web config, setting proxy User and Password).
Just create a dummy user field in front of the dummy password field to hide user name autocompletion:
<input type="text" style="display: none;" />
<input type="password" style="display: none;" />
<input type="password" name="password_update" />
Per the docs this is about the Login autocompletion. To disable the normal one (e.g. search terms completion), just use the
autocomplete="off"
attribute on the form or inputs. To disable both you need both, since the attribute won't disable Login autocompletion.