Show/Hide text using a checkbox?

Harry shared this question 7 years ago
Answered

Hi!


How can I add the following functionality to a checkbox: Show Text when checked, hide text when deckecked?


Thx!

Best Answer
photo

Just create an "On Toggle" + "Hide" event for the checkbox, with the Text as the target to be hidden.

ccd79d278a8c3de406211c19934e6232

Comments (7)

photo
1

Create a 'hide' event in the onclick option of the checkbox with a condition. Take a look at the attached image:d65d16f9520ec9422b07f40f676a293a

photo
1

Is it possible to do the same thing with a button? I.e. if I click on a text such as "login" to make the login boxes "appear" and "hide" each time I press that button?


I can get it to appear but not sure how to hide.


Thanks.

photo
1

Yes it is possible. But in this case you will need at least one variable in order to control when the button is pressed. Check out the following example where the login button shows and hides a group of inputs:


67dfc5538a92dac81c001705c3cbce54

photo
1

Thanks, that helped me as well.

photo
1

When I try to do this i dont understand how to get that else action please specify

photo
1

First you have to define the first condition (when login_pressed = 'false') -> shows Group_1. Then, just below that it will appear a link saying else. Click it and you will be able to define the else case. Take a look at this video http://www.justinmind.com/prototyper/... as well.

photo
1

Just create an "On Toggle" + "Hide" event for the checkbox, with the Text as the target to be hidden.

ccd79d278a8c3de406211c19934e6232