Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

JavaScript code for changing object type onclick Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
andrea763
Posts: 32
Joined: Tue Oct 17, 2023 7:41 am
Has thanked: 5 times

JavaScript code for changing object type onclick

Unread post by andrea763 »

Hello gusy, i've a password field on a edit form, i'd like to view in clear the contained text when i onlick on it.,
Is it possible with javascript?
How?
greetings
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: JavaScript code for changing object type onclick

Unread post by kev1n »

Hi,

Add this function in your form's Custom Code:

Code: Select all

function showPassword(element, showPassword) {
  element.type = showPassword ? 'text' : 'password';
}
Next, add these two events to your password field:
events.png
So, when you click on the password field with the mouse, the characters are unmasked and become visible. When the field loses focus, the characters are masked again.
You do not have the required permissions to view the files attached to this post.
andrea763
Posts: 32
Joined: Tue Oct 17, 2023 7:41 am
Has thanked: 5 times

Re: JavaScript code for changing object type onclick

Unread post by andrea763 »

Wow. Thanks a lot.
Post Reply