Skip to content
Advertisement

Reset Password Using Html and javascript

I Have a requirement where i have 3 input fields namely

1.old password
2.new password
3.confirm password.

For which i need to apply rules as follows.

1.Old and new passwords should not match.
2.No field should be empty.
3.New password and confirm password inputs should be same.

If all these validations passes then only form should be submitted.
Here is the Html file for which i need to apply js

JavaScript

thank you

Advertisement

Answer

Please replace with your ids..

JavaScript

An in thml you need to add

JavaScript

For reset you can create a function somting like this

JavaScript

and call when you want form reset.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement