Show Image When Passwords Match Help

inetwebguy shared this question 7 years ago
Answered

is it possible to Show/Hide an image when 2 text fields match? I'm trying to make a checkbox show when the password and confirm password field is the same

Comments (8)

photo
1

Sure! Piece of cake! Just create an event that shows the checkbox (that is marked as hidden) when (password input = confirm password input). This image shows how the event could look like:


9d1e5dc67aea04ff33c4a97035a6a09f

photo
1

This works but I was looking for a "real-time" solution, not an onClick event. most real-world applications of this technique give you an immediate validation upon successful match.

photo
1

The onClick was just an example. You can trigger the validation with an onchange event or an onkeypressed event over the text input fields.

photo
1

Im getting an error when I put the on Change event on the test field.. see image

photo
1

783441ff97395b151e4a8e05a88c483d


srry heres the image

photo
1

You have to insert an equals function so that the condition matches this: [(Input_1 = username) & (Input_2 = password)]

photo
1

But there is no user name field. What I'd like is:


I'm trying to re-create a passwords match confirmation. But not onClick. I'd like it to display immediately upon match. I am ok with predetermining what the password is.


if


Input_1 & Input_2 = "password123"


then


ShowImage1


else


ShowImage2


But in a real life situation, the user would be creating the password in their head and the form just validates if they match like this


if


Input_1 = Input_2


then


ShowImage1


else


ShowImage2

photo
1

Then you nearly have it when you pasted the last image. The only thing missing there is another equals function so the condition would be (input_1=input2) & (input_2='password')