Password Validation in JavaScript|| Form Validation|| Code With Neha

Опубликовано: 13 Декабрь 2024
на канале: Code With Neha
310
like

So today's topic is how to validate password in javascript or password validation in javascript
For a detailed guide on form validation using getElementById, check out my previous video linked above the 'I' button

So without any further delay let's get started with today's topic

Starting with our basic html structure

Within body tag creating a form

Taking our 1st html element as input type= text name as sname id as n1
Denoting Enter Username input

Similarly for Enter Password and confirm password

Taking input type as password ,name as pass for password and cpass for confirm password
I'd for password as pass
I'd for confirm password as cpass

Followed by button input type name as btn and value as login

Control s to save the changes And refresh the browser

You can see a form is created

To maintain gap between the user inputs Insertng br tags

To validate this login form
Using script tag in between head tag
You can use in body tag as well

Taking a onclick function as data () in our button tag

Now in the script tag
Using function data()
Declaring variables as a b c for username password and confirm password respectively

If a== null or b==null or c==null
Then alert message will be poped out as All fields are mandatory

Control s and refresh the browser to check its working or not

It's working

2nd validation is password validation

Else if b is not equals to c
Then alert message pops out as password did not match

Control s and refresh to check if it's working
Yes it's working

Now to close if else statement
Else

Alert message will Appear as login successful

That's it for today
Hope you all will get some help from this video If it's so then don't forget to subscribe my channel Code with Neha and press the Bell Icon to never miss an update
See you in the next video till then Stay Safe Stay Happy

#validationinjavascript
#validationinjavascriptforregistrationform
#passwordvalidationinjavascript
#validationinjavascriptforbeginners
#passwordvalidationinjavascriptforbeginners
#passwordvalidationinhtml
#passwordvalidationinhtmlforbeginners
#passwordvalidationinhtmlcssandjavascript
#howtovalidatepasswordinjavascript
#howtovalidatepasswordinjavascriptforbeginners
#howtovalidatepasswordandconfirmpasswordin javascript
#howtovalidateusernameandpasswordinjavascript
#howtocreatepasswordvalidationinjavascript
#howtocheckpasswordandconfirmpassword linjavascript
#javascriptformvalidation
#formvalidation
#formvalidationtutorial
#clientformvalidation
#formvalidationwithjavascript
#formvalidationusingjavascript
#htmlformvalidation
#formvalidationhtml
#javascriptformvalidationtutorial
#formvalidationinjavascripttutorial
#formvalidationwithhtml
#javascriptform
#javascriptformtutorial
#htmltutorial
#html
#htmlcode
#webdevelopment
#basichtml
#basichtmltags