Closed Vader16039 closed 7 months ago
You can do that like this:
First, set the hidden
value of all Input components you want to toggle to true
in the layout section when you edit the component.
After that, in the "UNLOCK" button. Add the "click" event and paste the below code:
const PASSWORD = 'YOUR_PASSWORD_HERE';
const PASSWORD_INPUT_COMP_ID = 'input6';
const COMP_IDS = ['input3', 'input2', 'input4'];
const inputPass = $vars.comps[PASSWORD_INPUT_COMP_ID].value.trim();
COMP_IDS.forEach((compId) => {
$helper.setCompData(compId, { hidden: inputPass !== PASSWORD });
})
There are several things you need to replace in the above code:
COMP_IDS
variable (['input3', 'input2', 'input4']
) with the ids of the components that you previously set the hidden
input to true
;PASSWORD_INPUT_COMP_ID
variable (input6
) with the component ID of the input component for inputting the password.Thanks @Kholid060 . This is works.
I want to toggle the text field visibilty based upon a password input. Can someone kindly help me here.
Before typing the password and clicking unlock.
After typing the password and clicking unlock.